Add Roborock Q10 volume number entity - #175732
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
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 existingvolumetranslation key. - Refactors
async_add_coordinator_entitiesinto anif/elif isinstancebranch structure (matchingselect.py) to support both V1 and Q10 coordinators. - Adds test fixture wiring for the Q10
volumetrait plus tests for set round-trip,unknownvalue, 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.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
fdd6a92 to
5a6dc9d
Compare
|
@joostlek thanks, fixed |
5555a5a to
a055332
Compare
|
Nice work @tubededentifrice |
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): readsapi.volumefrom the push-updated trait (registeringadd_update_listenerfor state updates, like the merged Q10 select/button/switch entities), writes throughset_volume, and reportsunknownwhile the trait value is stillNone. Reuses the existingvolumetranslation key. The test mock reuses theattach_update_listenersconftest helper introduced by the merged switch PR.No dependency bump: targets the already-pinned
python-roborockversion.Type of change
Additional information
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),
unknownwhen the trait value isNone, and the failure path asserting the translated error. Fulltests/components/roborocksuite passes locally (Python 3.14); ruff, mypy (strict) and hassfest clean.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: