Add select entities for Roborock q10 s5+#166142
Merged
allenporter merged 38 commits intohome-assistant:devfrom Apr 7, 2026
Merged
Add select entities for Roborock q10 s5+#166142allenporter merged 38 commits intohome-assistant:devfrom
allenporter merged 38 commits intohome-assistant:devfrom
Conversation
Add select entity support for Q10 devices with: - RoborockQ10CleanModeSelectEntity for setting cleaning mode - Helper function _get_q10_cleaning_mode to extract current mode from Q10 data - Integration with Q10UpdateCoordinator for push-based updates - Support for YXCleanType enum modes (vacuum, vac_and_mop, mop, auto, etc.) - Async command sending with set_clean_mode via Q10 vacuum trait All existing select tests pass (18/18) for V1, Q7, and Zeo devices.
Add test coverage for the new RoborockQ10CleanModeSelectEntity: - test_q10_cleaning_mode_select_current_option: Verify entity exists with valid options - test_q10_cleaning_mode_select_update_success: Test setting a valid cleaning mode - test_q10_cleaning_mode_select_update_failure: Test error handling when API call fails All select tests pass (21/18 - 3 new Q10 tests added).
Add translation keys for Q10 specific cleaning modes: - both_work: Vacuum and mop - only_sweep: Vacuum only - only_mop: Mop only Keep existing Q7 mode translations for backward compatibility.
|
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
|
- Add _map_q10_clean_mode_to_state_key() function to map YXCleanType enum values to existing Q7 keys - BOTH_WORK → vac_and_mop - ONLY_SWEEP → vacuum - ONLY_MOP → mop - Remove duplicate translations from strings.json (both_work, only_sweep, only_mop) - Update Q10 entity to use mapped state keys instead of enum names - Update tests to use correct mapped option names - All 21 select tests passing (18 existing + 3 Q10)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new select entity to the Roborock integration to control Q10 S5+ cleaning mode, with corresponding translations and tests.
Changes:
- Add
RoborockQ10CleanModeSelectEntityand wire it intoasync_setup_entryfor Q10 coordinators. - Extend
strings.jsonwith additionalcleaning_modestate translations used by Q10. - Add initial tests covering entity existence and service calls for the new Q10 select.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
homeassistant/components/roborock/select.py |
Adds a Q10 cleaning mode select entity and setup wiring. |
homeassistant/components/roborock/strings.json |
Adds translations for new Q10 cleaning mode option keys. |
tests/components/roborock/test_select.py |
Adds tests for Q10 cleaning mode select existence and service behavior. |
…update references
…rror for invalid options
allenporter
requested changes
Mar 21, 2026
Replace manual loop with next() + walrus operator. YXCleanType is a StrEnum so members compare equal to their string values.
allenporter
requested changes
Apr 5, 2026
Contributor
allenporter
left a comment
There was a problem hiding this comment.
One last change i think we need to make in the main library before we can submit this since there is a problem with the initial import (my mistake)
Q10Status.clean_mode is now correctly typed as YXCleanType in the library, so the intermediate from_code_optional lookup is no longer needed.
21 tasks
allenporter
approved these changes
Apr 7, 2026
Contributor
|
Nice work @lboue thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
This PR adds a cleaning mode select entity for the Roborock Q10 S5+ integration.
RoborockQ10CleanModeSelectEntityto expose cleaning mode selection in Home Assistant.BOTH_WORK→vac_and_mopONLY_SWEEP→vacuumONLY_MOP→mopYXCleanType.UNKNOWNis filtered out directly in theoptionsproperty and treated asNoneincurrent_option, keeping the entity consistent with other select entities in the integration.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: