Add Roborock Q10 position, zone cleaning, and goto support - #177780
Add Roborock Q10 position, zone cleaning, and goto support#177780hmmbob wants to merge 3 commits into
Conversation
|
Hey there @Lash-L, @allenporter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
Adds Roborock Q10 position reporting, zoned cleaning, and emulated goto support.
Changes:
- Exposes Q10 position and native zone cleaning.
- Emulates goto using a monitored mini-zone task.
- Adds translated errors and targeted tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
homeassistant/components/roborock/vacuum.py |
Implements Q10 actions and goto monitoring. |
homeassistant/components/roborock/strings.json |
Adds Q10 validation messages. |
tests/components/roborock/test_vacuum.py |
Tests the new Q10 behavior. |
Suppressed comments (1)
homeassistant/components/roborock/vacuum.py:818
- Validate the command before cancelling the active goto monitor. An invalid command currently raises
ServiceValidationErrorafter orphaning the still-running mini-zone task.
self._cancel_goto_monitor()
if (dp_command := B01_Q10_DP.from_any_optional(command)) is None:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="invalid_command",
translation_placeholders={
"command": command,
},
)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
homeassistant/components/roborock/vacuum.py:788
- Restore the complete pull-request template in the PR description. The required
Type of change,Additional information, and fullChecklistsections and unchecked options are missing.
"""Move the Q10 to a position using the library goto operation."""
tests/components/roborock/test_vacuum.py:981
- Cover the new Q10 action failure handling in tests. The added tests exercise only successful
goto_positionandclean_zonecalls, while neither theValueErrorvalidation translations nor theRoborockExceptioncommand-failure paths are covered; the existing Q10 failure fixture and parametrization also omit both methods.
"""Test that Q10 goto delegates the complete operation to the library."""
| raise ServiceNotSupported(DOMAIN, "set_vacuum_goto_position", self.entity_id) | ||
| """Move the Q10 to a position using the library goto operation.""" | ||
| try: | ||
| await self.coordinator.api.vacuum.goto_position(x, y) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
homeassistant/components/roborock/vacuum.py:790
- Update the python-roborock pin and generated requirements before enabling this call. The integration and
requirements_all.txtare still pinned to 5.31.1, while the PR description states thatgoto_positioncomes from the unreleased python-roborock#908 change; with the currently declared dependency this service path cannot use the new API and will fail at runtime. This is required before merge.
await self.coordinator.api.vacuum.goto_position(x, y)
tests/components/roborock/test_vacuum.py:1167
- Configure
cancel_gotoas a synchronous mock before exercising this path.q10_vacuum_api.vacuumis anAsyncMock(tests/components/roborock/conftest.py:229), so its automatically createdcancel_gotochild is also async; the production code calls it synchronously, causing this test to create an unawaited coroutine whileassert_called_once_withmasks the mismatch.
q10_vacuum_api.vacuum.cancel_goto.assert_called_once_with()
|
Keeping draft status until package bump (which is also why tests currently fail) |
Proposed change
Add Q10/B01 support for these existing Roborock actions:
roborock.get_vacuum_current_positionroborock.set_vacuum_zoned_cleaningroborock.set_vacuum_goto_positionQ10 position uses the live trace and zoned cleaning uses the device's native zone task. Q10 firmware has no native goto command, so python-roborock #908 implements it with the app's minimum 40 x 40 cm zone, pauses within 20 cm of the target, and avoids controlling a task that has since been replaced.
This PR remains a draft until python-roborock #908 is released and the Core dependency can be updated.
Tested on a Roborock Q10 (
roborock.vacuum.ss07) with firmware 03.11.24. Target(29900, 28650)paused at(30020, 28705), 13.2 cm away, and the robot stayed at the destination. The focused library and custom integration tests pass.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: