master
The connect/disconnect-every-cycle approach caused ~50% failure rate over 48h — each of the ~2880 daily connection attempts per device had a significant chance of failure through ESPHome proxies. New model (same as the user's Android app): - Connect once, keep the connection alive across poll cycles - _ensure_connected() reconnects automatically if the link drops - _on_disconnect() callback detects unexpected disconnections - On timeout, force-disconnect so next cycle gets a clean reconnect - Polls now only send commands (no connection overhead) — expected completion in <1s instead of 10-25s Connection lifecycle: startup → first poll → _ensure_connected() → persistent drop detected → next poll → _ensure_connected() → reconnected shutdown → async_teardown() → disconnect() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Description
No description provided
Languages
Python
100%