Recover A01 devices after sleep and support push updates - #898
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves robustness and observability for A01 devices by (1) reporting query success/timeout to the MQTT session health manager (enabling automatic recovery after sleep/stalls) and (2) adding an API listener to consume unsolicited/pushed device state updates for Dyad devices.
Changes:
- Added
DyadApi.add_listener()to subscribe to pushed A01 RPC messages and deliver decoded/converted datapoints for known Dyad protocols. - Updated A01 RPC query flow to report
on_timeout()/on_success()to the MQTTHealthManager. - Added tests covering pushed-message listener behavior and health-manager reporting on query success/timeout.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/devices/traits/a01/test_init.py | Adds coverage for Dyad add_listener() delivering decoded values and ignoring unknown codes/unsubscribed callbacks. |
| tests/devices/rpc/test_a01_channel.py | Verifies A01 queries report success/timeouts to the health manager. |
| roborock/devices/traits/a01/init.py | Implements DyadApi.add_listener() and documents the new API method. |
| roborock/devices/rpc/a01_channel.py | Calls health_manager.on_timeout() on query timeout and health_manager.on_success() on successful completion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Going to leave this one for @allenporter before I merge, looks good to me, but RPC channels are definitely more his domain! Happy to see someone contributing logic for A01 devices though 👀 |
|
Please address CI Lint errors |
|
Done ! Should be good now. |
Proposed change
A01 devices (Dyad wet/dry vacuums, Zeo washers) could stop responding after going to sleep and never recover on their own. They now reconnect automatically, and Dyad vacuums can report state changes as they happen instead of only when polled.
Both changes are tested on a Roborock F25 XT (
roborock.wetdryvac.a238). The listener change will need a HA core change to take effect (I'll open a PR for that)