refactor(q10): harmonize enum state values across Q10 modes#797
Closed
lboue wants to merge 3 commits intoPython-roborock:mainfrom
Closed
refactor(q10): harmonize enum state values across Q10 modes#797lboue wants to merge 3 commits intoPython-roborock:mainfrom
lboue wants to merge 3 commits intoPython-roborock:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Q10 (B01) code-mapping enums to expose more consistent, readable, cross-device state labels from python-roborock, and adds tests to lock the new values in place.
Changes:
- Harmonize
YXDeviceState.FAULT_STATEvalue from"fault"to"error". - Convert several Q10 enum string values to clearer snake_case / canonical labels (e.g.,
back_dusting,vac_and_mop,creating_map). - Add targeted unit tests asserting the updated enum
.valuestrings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
roborock/data/b01_q10/b01_q10_code_mappings.py |
Updates Q10 enum exposed string values for fault/back type/work mode/clean task to harmonized labels. |
tests/data/b01_q10/test_b01_q10_code_mappings.py |
Updates expected canonical status mapping to match FAULT_STATE="error". |
tests/data/test_code_mappings.py |
Adds focused assertions for the newly harmonized Q10 enum values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
allenporter
requested changes
Mar 22, 2026
| assert product.category == RoborockCategory.UNKNOWN | ||
|
|
||
|
|
||
| def test_yx_device_state_fault_uses_error_value() -> None: |
Contributor
There was a problem hiding this comment.
I'm not sure these tests are super meaningful, plus we'd probably want them in the q10 directory instead of randomly split across the two directories. Please just revert.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
python-roborockto make automation behavior more consistent across device variants.YXDeviceState:FAULT_STATEchanges fromfaulttoerror.YXBackType:backdusting/backchargingbecomeback_dusting/back_charging.YXDeviceWorkMode:bothwork/onlysweep/onlymopbecomevac_and_mop/vacuum/mop, andsaveworry/sweepmopbecomesave_worry/sweep_mop.YXDeviceCleanTask:divideareas/creatingmapbecomedivide_areas/creating_map.Tests
uv run pytest tests/data/test_code_mappings.pyNotes