Skip to content

Add Roborock Q10 position, zone cleaning, and goto support - #177780

Draft
hmmbob wants to merge 3 commits into
home-assistant:devfrom
hmmbob:agent/q10-zone-position-support
Draft

Add Roborock Q10 position, zone cleaning, and goto support#177780
hmmbob wants to merge 3 commits into
home-assistant:devfrom
hmmbob:agent/q10-zone-position-support

Conversation

@hmmbob

@hmmbob hmmbob commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Add Q10/B01 support for these existing Roborock actions:

  • roborock.get_vacuum_current_position
  • roborock.set_vacuum_zoned_cleaning
  • roborock.set_vacuum_goto_position

Q10 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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: N/A
  • This PR is related to issue: python-roborock #908
  • Link to documentation pull request: Not required; this extends existing Roborock actions to Q10
  • Link to developer documentation pull request: N/A
  • Link to frontend pull request: N/A

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings July 31, 2026 14:40
@home-assistant home-assistant Bot added cla-signed has-tests integration: roborock Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage labels Jul 31, 2026
@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @Lash-L, @allenporter, mind taking a look at this pull request as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roborock can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign roborock Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

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 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 ServiceValidationError after 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,
                },
            )

Comment thread homeassistant/components/roborock/vacuum.py Outdated
Comment thread homeassistant/components/roborock/vacuum.py Outdated
Comment thread homeassistant/components/roborock/vacuum.py Outdated
Comment thread homeassistant/components/roborock/vacuum.py Outdated
Comment thread tests/components/roborock/test_vacuum.py Outdated
Comment thread homeassistant/components/roborock/vacuum.py
Copilot AI review requested due to automatic review settings July 31, 2026 15:07

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

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 full Checklist sections 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_position and clean_zone calls, while neither the ValueError validation translations nor the RoborockException command-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)
Copilot AI review requested due to automatic review settings July 31, 2026 15:15

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

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.txt are still pinned to 5.31.1, while the PR description states that goto_position comes 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_goto as a synchronous mock before exercising this path. q10_vacuum_api.vacuum is an AsyncMock (tests/components/roborock/conftest.py:229), so its automatically created cancel_goto child is also async; the production code calls it synchronously, causing this test to create an unawaited coroutine while assert_called_once_with masks the mismatch.
    q10_vacuum_api.vacuum.cancel_goto.assert_called_once_with()

@hmmbob

hmmbob commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Keeping draft status until package bump (which is also why tests currently fail)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed has-tests integration: roborock Quality Scale: silver Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants