diff --git a/server/services/ha_service.py b/server/services/ha_service.py index 2cc402d..8e6a752 100644 --- a/server/services/ha_service.py +++ b/server/services/ha_service.py @@ -136,6 +136,14 @@ _SWITCH_EXCLUDE_EXACT = { "Moneyboy", } +# Switches whose friendly_name contains these substrings are technical settings +_SWITCH_EXCLUDE_SUBSTRINGS = ( + "Child lock", + "Led indication", + "Indicator", + "Permit join", +) + # Sensor friendly_names containing these substrings are hardware, not room sensors _SENSOR_EXCLUDE_SUBSTRINGS = ( "System: CPU", @@ -216,11 +224,13 @@ async def fetch_ha_data(url: str, token: str) -> Dict[str, Any]: lights.append(_parse_light(entity)) elif domain == "switch": - # Skip Unraid infrastructure switches + # Skip Unraid infrastructure switches + technical settings if friendly in _SWITCH_EXCLUDE_EXACT: continue if any(friendly.startswith(p) for p in _SWITCH_EXCLUDE_PREFIXES): continue + if any(sub in friendly for sub in _SWITCH_EXCLUDE_SUBSTRINGS): + continue switches.append(_parse_switch(entity)) elif domain == "cover":