feat: add stateful A01 device simulators (Dyad and Zeo) to roborock.testing - #910
Open
allenporter wants to merge 7 commits into
Open
feat: add stateful A01 device simulators (Dyad and Zeo) to roborock.testing#910allenporter wants to merge 7 commits into
allenporter wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a stateful testing harness for Roborock A01 protocol devices (Dyad and Zeo) so higher-level APIs and DeviceManager flows can be exercised in unit/integration tests without real hardware.
Changes:
- Introduces
A01DeviceSimulatorplusDyadSimulator/ZeoSimulator, including default product/device/status fixtures and enum-aware setters. - Updates
FakeRoborockCloud.patch_device_manager()to route A01 devices to the new simulator during MQTT channel creation. - Adds a dedicated test suite covering defaults, setter behavior, API query/set flows, and end-to-end device discovery.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
roborock/testing/a01_simulator.py |
New stateful A01 simulators, defaults, and MQTT publish/query handling. |
roborock/testing/cloud.py |
Extends fake cloud channel routing to support A01 simulators. |
roborock/testing/__init__.py |
Exposes A01 simulator classes and default constants from roborock.testing. |
tests/testing/test_a01_simulator.py |
Adds unit/integration coverage for A01 simulator + API + device manager discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…TUS, DEFAULT_ZEO_STATUS, and simulator status params
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.
Summary
Adds stateful device firmware simulators for A01 protocol devices (Dyad wet/dry vacuums and Zeo washing machines) to
roborock.testing.Changes
A01DeviceSimulator,DyadSimulator, andZeoSimulatorinroborock/testing/a01_simulator.pywith AES-padded payload decoding/encoding (b"A01"version).set_protocol_value(protocol, value, push=False)supporting enum members (RoborockDyadDataProtocol,RoborockZeoProtocol,DyadSuction,ZeoState, etc.) and raw primitive values.set_state,set_suction,set_water_level,set_program,set_temperature, etc.).DEFAULT_DYAD_PRODUCT,DEFAULT_DYAD_DEVICE_INFO,DEFAULT_DYAD_STATUS,DEFAULT_ZEO_PRODUCT,DEFAULT_ZEO_DEVICE_INFO,DEFAULT_ZEO_STATUS).FakeRoborockCloud.patch_device_manager()incloud.pyto support A01 devices during discovery.tests/testing/test_a01_simulator.py.Verification
Ran test suite (
uv run python -m pytest), all 896 tests passed.