diff --git a/bridge/aria_bridge.py b/bridge/aria_bridge.py index a49e673..a46146b 100644 --- a/bridge/aria_bridge.py +++ b/bridge/aria_bridge.py @@ -37,7 +37,7 @@ import websockets from faster_whisper import WhisperModel from openwakeword.model import Model as WakeWordModel -from modes import Mode, detect_mode_switch, mode_from_id, should_speak +from modes import Mode, canonical_id, detect_mode_switch, mode_from_id, should_speak # ── Logging ────────────────────────────────────────────────── @@ -921,7 +921,7 @@ class ARIABridge: await self._send_to_rvs({ "type": "mode", "payload": { - "mode": self.current_mode.name.lower(), + "mode": canonical_id(self.current_mode), "name": self.current_mode.config.name, "emoji": self.current_mode.config.emoji, "sender": "bridge", # Filter in mode-Handler gegen Loops diff --git a/bridge/modes.py b/bridge/modes.py index 5b53860..4ea040d 100644 --- a/bridge/modes.py +++ b/bridge/modes.py @@ -110,6 +110,21 @@ def mode_from_id(mode_id: str) -> Optional[Mode]: return _ID_MAP.get(mode_id.strip().lower()) +# Kanonische IDs fuer Broadcasts (matchen die App-UI-IDs in ModeSelector) +_CANONICAL_ID: dict[Mode, str] = { + Mode.NORMAL: "normal", + Mode.DND: "nicht_stoeren", + Mode.WHISPER: "fluester", + Mode.HANGAR: "hangar", + Mode.GAMING: "gaming", +} + + +def canonical_id(mode: Mode) -> str: + """Kanonische ID die App + Diagnostic + Bridge gleichermassen kennen.""" + return _CANONICAL_ID.get(mode, mode.name.lower()) + + def detect_mode_switch(text: str) -> Optional[Mode]: """Erkennt ob ein Text eine Modus-Umschaltung enthaelt. diff --git a/diagnostic/index.html b/diagnostic/index.html index 14e12df..c567151 100644 --- a/diagnostic/index.html +++ b/diagnostic/index.html @@ -383,10 +383,10 @@ - -