homelab-codex-ws/services/ha-diag-agent/tests
Oskar Kapala 31b48d162a feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness
- persistent WS connection to HA with auth + state_changed subscription
- watchdog detects silence > 5min → emits ha_websocket_dead
- immediate ha_websocket_dead on disconnect, exponential reconnect with jitter
- cooldown prevents alert spam (10min repeat window while HA stays down)
- ha_websocket_recovered emitted on reconnect after a dead alert (allows
  supervisor to clear active incidents in Phase 5)
- new monitors/ subpackage for long-running tasks (vs interval checks/)
- /health endpoint now includes ws_connected field
- 26 unit tests, 3 integration tests (real HA + container stop/restart)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 15:00:18 +02:00
..
integration feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
conftest.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_automation_failures.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_event_emitter.py feat(ha-diag-agent): test environment with dual HA Docker instances 2026-05-29 12:56:13 +02:00
test_ha_client.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_heartbeat_check.py feat(ha-diag-agent): UnavailableEntitiesCheck with root cause dedup 2026-05-29 13:41:55 +02:00
test_system_health.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_unavailable_entities.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_updates_available.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_websocket_monitor.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00