Files
linux-voice-assistant/linux_voice_assistant
d811ae75d4 Broadcast entity state to all API clients; don't desync on a second connection (#329)
The ESPHome API server delivered asynchronous entity-state changes to a single
connection (the entity's `server`), which every new connection reassigns. A
second API client — a diagnostic tool, a second dashboard, or Home Assistant's
own overlapping reconnect — therefore stole state delivery, leaving Home
Assistant stuck on a stale state (e.g. `media_player` showing `playing` after
playback had finished). `connection_lost` also stopped the shared music/TTS
players for *any* dropped connection.

- models.py: add a per-server connection registry and a `broadcast()` helper.
- satellite.py: register/deregister connections in connection_made/_lost; only
  stop shared playback when the last client disconnects; handle the standard
  `SubscribeStatesRequest` by replaying current entity state to the subscriber.
- entity.py: push playback-completion state via broadcast to all clients.

Co-authored-by: Omar Amin <65174210+omaramin-2000@users.noreply.github.com>
Co-authored-by: Florian Asche <github@florian-asche.de>
2026-07-15 19:11:54 +02:00
..
2025-08-26 09:30:58 -05:00
2026-07-03 19:58:45 +03:00
2026-04-21 02:04:11 +02:00