Skip to content

feat: add stateful A01 device simulators (Dyad and Zeo) to roborock.testing - #910

Open
allenporter wants to merge 7 commits into
Python-roborock:mainfrom
allenporter:feat-a01-testing-support
Open

feat: add stateful A01 device simulators (Dyad and Zeo) to roborock.testing#910
allenporter wants to merge 7 commits into
Python-roborock:mainfrom
allenporter:feat-a01-testing-support

Conversation

@allenporter

Copy link
Copy Markdown
Contributor

Summary

Adds stateful device firmware simulators for A01 protocol devices (Dyad wet/dry vacuums and Zeo washing machines) to roborock.testing.

Changes

  • Implemented A01DeviceSimulator, DyadSimulator, and ZeoSimulator in roborock/testing/a01_simulator.py with AES-padded payload decoding/encoding (b"A01" version).
  • Added set_protocol_value(protocol, value, push=False) supporting enum members (RoborockDyadDataProtocol, RoborockZeoProtocol, DyadSuction, ZeoState, etc.) and raw primitive values.
  • Exposed explicit named helper setters (set_state, set_suction, set_water_level, set_program, set_temperature, etc.).
  • Defined and exported module-level default constants (DEFAULT_DYAD_PRODUCT, DEFAULT_DYAD_DEVICE_INFO, DEFAULT_DYAD_STATUS, DEFAULT_ZEO_PRODUCT, DEFAULT_ZEO_DEVICE_INFO, DEFAULT_ZEO_STATUS).
  • Updated FakeRoborockCloud.patch_device_manager() in cloud.py to support A01 devices during discovery.
  • Added 9 dedicated unit and integration tests in tests/testing/test_a01_simulator.py.

Verification

Ran test suite (uv run python -m pytest), all 896 tests passed.

Copilot AI review requested due to automatic review settings August 2, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 A01DeviceSimulator plus DyadSimulator/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.

Comment thread roborock/testing/a01_simulator.py Outdated
Comment thread roborock/testing/a01_simulator.py Outdated
@allenporter
allenporter requested a review from Lash-L August 2, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants