Add VacuumTrait to q10 devices#754
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a VacuumTrait to Q10 devices, providing a clean interface for vacuum-related commands. The implementation follows a trait-based architecture where VacuumTrait wraps the existing CommandTrait to provide vacuum-specific methods.
Changes:
- Created VacuumTrait class implementing vacuum commands (start, pause, resume, stop, return to dock)
- Integrated VacuumTrait into Q10PropertiesApi as a new property
- Added comprehensive test coverage for all vacuum commands
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 15 comments.
| File | Description |
|---|---|
| roborock/devices/traits/b01/q10/vacuum.py | New VacuumTrait class implementing vacuum control commands using the CommandTrait |
| roborock/devices/traits/b01/q10/init.py | Integration of VacuumTrait into Q10PropertiesApi with new imports and vacuum property |
| tests/devices/traits/b01/q10/test_vacuum.py | Parametrized test coverage for all vacuum trait commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._channel = channel | ||
| self._task: asyncio.Task | None = None |
There was a problem hiding this comment.
The instance variables '_channel' and '_task' are assigned but never used. If these are intended for future functionality, consider removing them until they are needed. Otherwise, they should be utilized or removed to avoid confusion.
Co-authored-by: Copilot <[email protected]>
…rock into q10-vacuum-trait
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
roborock/devices/traits/b01/q10/init.py:11
- The logger is imported and defined but never used in this file. Consider removing the unused import and logger definition, or add logging statements where appropriate if logging is intended for future use.
from roborock.devices.traits import Trait
from roborock.devices.transport.mqtt_channel import MqttChannel
from .command import CommandTrait
from .vacuum import VacuumTrait
__all__ = [
"Q10PropertiesApi",
]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| (lambda x: x.return_to_dock(), {"203": {}}), | ||
| ], | ||
| ) | ||
| async def test_vacuum_commands( |
There was a problem hiding this comment.
The test function name "test_q7_api_set_fan_speed" is incorrect for testing Q10 vacuum commands. It appears to be copied from Q7 tests. The name should reflect that it's testing Q10 vacuum commands, such as "test_q10_vacuum_commands".
| async def test_vacuum_commands( | |
| async def test_q10_vacuum_commands( |
Co-authored-by: Copilot <[email protected]>
- test_q10_simple.py: Interactive test script with detailed debug info - test_q10_vacuum.py: Basic test script for Q10 vacuum commands These scripts test the VacuumTrait functionality added in PR Python-roborock#754
|
I just tested it and it works great with my Roborock Q10 S5+. It's awesome! |
I defined this as a separate trait in case this could be useful to use across multiple device types. For now this just implements some of the q10 commands.
This PR has not yet been tested fully against a real device, but likely works given some previous testing against an older iteration.