Skip to content

Conversation

@allenporter
Copy link
Contributor

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.

Copilot AI review requested due to automatic review settings January 27, 2026 04:40
Copy link
Contributor

Copilot AI left a 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.

Comment on lines 35 to 36
self._channel = channel
self._task: asyncio.Task | None = None
Copy link

Copilot AI Jan 27, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a 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(
Copy link

Copilot AI Jan 27, 2026

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".

Suggested change
async def test_vacuum_commands(
async def test_q10_vacuum_commands(

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
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