From 81b2327e840a832edcd5bb434dfc302097909d6b Mon Sep 17 00:00:00 2001 From: Otto Date: Sun, 26 Jul 2026 23:18:19 +0200 Subject: [PATCH] Filter room management maintenance actions --- CHANGELOG.md | 8 ++++++++ addon/config.yaml | 2 +- app/api/v1/actuators.py | 37 +++++++++++++++++++++++++++++++++++++ app/main.py | 2 +- pyproject.toml | 2 +- 5 files changed, 48 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a941e..6eedee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.7.8 - 2026-07-26 +- Raumverwaltung blendet Wartungs-/Diagnose-Aktoren wie Batterie-Reset, + Ping, Identify, Restart/Reboot/Reload und Wake-on-LAN aus den + Raumvorschlägen aus. +- Dadurch bleiben Räume auf nutzbare Steuerungen fokussiert: Licht, Strom, + Schalter, Steckdosen, Heizung, Wasser, Belüftung, Sicherheit, Rollos und + echte Szenen/Regler. + ## 1.7.7 - 2026-07-26 - Raumverwaltung erzeugt jetzt eine vollständige Übersicht aus allen Home-Assistant-Bereichen, nicht nur aus bereits konfigurierten Aktoren. diff --git a/addon/config.yaml b/addon/config.yaml index 25a799d..6386171 100644 --- a/addon/config.yaml +++ b/addon/config.yaml @@ -1,5 +1,5 @@ name: SillyHome Next -version: "1.7.7" +version: "1.7.8" slug: sillyhome_next description: Lernt automatisch aus deinem Verhalten und steuert freigegebene Aktoren url: http://192.168.6.31:3000/pino/sillyhome-next diff --git a/app/api/v1/actuators.py b/app/api/v1/actuators.py index c25f95b..e22d2c1 100644 --- a/app/api/v1/actuators.py +++ b/app/api/v1/actuators.py @@ -604,6 +604,8 @@ def room_management_overview(request: Request) -> RoomManagementOverview: actuator = entities.get(entity_id) if actuator is None: continue + if not _is_management_actuator(actuator): + continue room = _entity_room(actuator) if room not in rooms: rooms[room] = RoomManagementGroup(room=room, actuator_count=0) @@ -1151,6 +1153,41 @@ def _entity_room(entity: HaEntitySummary) -> str: return room or "Ohne Raum" +def _is_management_actuator(entity: HaEntitySummary) -> bool: + if entity.domain not in { + "climate", + "cover", + "fan", + "humidifier", + "input_boolean", + "light", + "lock", + "number", + "scene", + "siren", + "switch", + "valve", + }: + return False + text = " ".join( + str(value).lower().replace("_", " ") + for value in [entity.entity_id, entity.friendly_name, entity.device_name] + if value + ) + noisy_tokens = { + "battery replaced", + "identify", + "ping", + "reboot", + "reload", + "restart", + "wake on lan", + } + if any(token in text for token in noisy_tokens): + return False + return True + + def _room_from_text(value: str) -> str | None: normalized = value.replace("_", " ").replace("-", " ").strip() if not normalized: diff --git a/app/main.py b/app/main.py index 1bb01cf..03528d0 100644 --- a/app/main.py +++ b/app/main.py @@ -117,7 +117,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]: app = FastAPI( title="SillyHome Next API", description="Lokales Smart-Home-Intelligenzsystem für Home Assistant.", - version="1.7.7", + version="1.7.8", lifespan=lifespan, ) app.state.settings = load_settings() diff --git a/pyproject.toml b/pyproject.toml index 1447d80..632dd43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sillyhome-next" -version = "1.7.7" +version = "1.7.8" description = "Lokales Smart-Home-Intelligenzsystem für Home Assistant" requires-python = ">=3.11" dependencies = [