Skip to content

Add Roborock Q10 volume number entity - #175732

Merged
allenporter merged 2 commits into
home-assistant:devfrom
tubededentifrice:roborock-q10-number
Jul 7, 2026
Merged

Add Roborock Q10 volume number entity#175732
allenporter merged 2 commits into
home-assistant:devfrom
tubededentifrice:roborock-q10-number

Conversation

@tubededentifrice

@tubededentifrice tubededentifrice commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Adds the volume number entity for the Roborock Q10 (B01/ss07). Split out to one platform per PR as requested in #173883; switch (#175731, merged) and image (#173883) are separate PRs.

Mirrors the V1 volume number entity via a Q10-specific description (RoborockNumberDescriptionQ10 / RoborockNumberEntityQ10): reads api.volume from the push-updated trait (registering add_update_listener for state updates, like the merged Q10 select/button/switch entities), writes through set_volume, and reports unknown while the trait value is still None. Reuses the existing volume translation key. The test mock reuses the attach_update_listeners conftest helper introduced by the merged switch PR.

No dependency bump: targets the already-pinned python-roborock version.

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: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Sibling per-platform PRs from the same split: #175731 (switch, merged), #173883 (image).

Testing: new tests cover the set-value round trip (asserting the trait call and the listener-pushed state), unknown when the trait value is None, and the failure path asserting the translated error. Full tests/components/roborock suite passes locally (Python 3.14); ruff, mypy (strict) and hassfest clean.

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 6, 2026 04:57
@home-assistant home-assistant Bot added cla-signed has-tests integration: roborock new-feature Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage labels Jul 6, 2026
@home-assistant

home-assistant Bot commented Jul 6, 2026

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

This PR adds a volume number entity for the Roborock Q10 (B01/ss07) vacuum. It is part of a series of PRs (one platform per PR) that add Q10 support, following the pattern of the already-merged Q10 select/button/DND entities. The new entity reads api.volume from a push-updated trait, registers an add_update_listener for state updates, writes through set_volume, and reports unknown while the trait value is None.

Changes:

  • Adds RoborockNumberDescriptionQ10 / RoborockNumberEntityQ10 (a coordinated Q10 entity) that mirrors the V1 volume number entity and reuses the existing volume translation key.
  • Refactors async_add_coordinator_entities into an if/elif isinstance branch structure (matching select.py) to support both V1 and Q10 coordinators.
  • Adds test fixture wiring for the Q10 volume trait plus tests for set round-trip, unknown value, and failure path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
homeassistant/components/roborock/number.py Adds Q10 number description/entity and branches entity setup by coordinator type, consistent with select.py and merged Q10 entities.
tests/components/roborock/conftest.py Adds a mocked volume trait with add_update_listener/set_volume side effects, mirroring the existing DND listener fixture.
tests/components/roborock/test_number.py Adds Q10 tests for set round-trip (with listener push), unknown value, and translated failure path.

I verified the imports (Q10PropertiesApi, SoundVolumeTrait, RoborockB01Q10UpdateCoordinator, RoborockCoordinatedEntityB01Q10) resolve and match usage in switch.py/coordinator.py, the setup refactor matches the established select.py pattern, the add_update_listener registration is symmetrical via async_on_remove, the update_options_failed translation key exists (strings.json:711), and the tests follow the conventions of the existing V1 tests in the same file. No objective issues were found.

@joostlek joostlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are merge conflicts

@home-assistant
home-assistant Bot marked this pull request as draft July 6, 2026 09:34
@home-assistant

home-assistant Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@tubededentifrice
tubededentifrice marked this pull request as ready for review July 6, 2026 14:17
Copilot AI review requested due to automatic review settings July 6, 2026 14:17
@home-assistant
home-assistant Bot requested a review from joostlek July 6, 2026 14:17

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.

@tubededentifrice

Copy link
Copy Markdown
Contributor Author

@joostlek thanks, fixed

Copilot AI review requested due to automatic review settings July 7, 2026 14:57

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 4 comments.

Comment thread tests/components/roborock/conftest.py Outdated
Comment thread tests/components/roborock/test_number.py
Comment thread tests/components/roborock/test_number.py
Comment thread tests/components/roborock/test_number.py
Copilot AI review requested due to automatic review settings July 7, 2026 16:56

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.

@allenporter

Copy link
Copy Markdown
Contributor

Nice work @tubededentifrice

@allenporter
allenporter dismissed joostlek’s stale review July 7, 2026 22:47

Merge conflict has been resolved

@allenporter
allenporter merged commit 53f0736 into home-assistant:dev Jul 7, 2026
33 checks passed
@tubededentifrice
tubededentifrice deleted the roborock-q10-number branch July 8, 2026 15:07
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed has-tests integration: roborock new-feature 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.

4 participants