-
Notifications
You must be signed in to change notification settings - Fork 61
Add VacuumTrait to q10 devices #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]>
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.