Skip to content

Commit d3867fc

Browse files
authored
configuration["discovery_filter"] convert from string for HA Add-on and Docker (#302)
1 parent 78bcb01 commit d3867fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

TheengsGateway/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def main() -> None:
5858
if not configuration["host"]:
5959
sys.exit("MQTT host is not specified")
6060

61+
# Make sure discovery_filter is a list, and convert to list
62+
# if it is actually a string (Docker and HA Add-in)
63+
if isinstance(configuration["discovery_filter"], str):
64+
# Convert the string to a list by removing brackets and splitting by commas
65+
configuration["discovery_filter"] = configuration["discovery_filter"].strip("[]").split(",")
66+
6167
# Remove possible discovery filter remnants not required after the RMAC introduction
6268
if "GAEN" in configuration["discovery_filter"]:
6369
configuration["discovery_filter"].remove("GAEN")

0 commit comments

Comments
 (0)