Recover A01 devices after sleep and support push updates#898
Open
piitaya wants to merge 2 commits into
Open
Conversation
Contributor
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.
Collaborator
|
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 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)