From 0d68933b858c4f4a1a3017597876b5253c5c064d Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 2 Mar 2026 19:40:25 +0100 Subject: [PATCH] Further filter technical switches (child locks, LED indicators, permit join) Removes child lock toggles, motion sensor LED indicators, and Zigbee2MQTT permit join from the smart-home dashboard view. Co-Authored-By: Claude Opus 4.6 --- server/services/ha_service.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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":