feat(api)!: Again rename YXDeviceState enum members to have consistency with V1 state values#795
Merged
Lash-L merged 1 commit intoPython-roborock:mainfrom Mar 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the B01/Q10 YXDeviceState enum member names (and several string values) with the canonical V1 state naming, reducing the need for device-specific state handling across the codebase.
Changes:
- Renamed
YXDeviceStatemembers inb01_q10_code_mappings.pyto match V1-style state naming (e.g.,CHARGING_STATE→CHARGING,TO_CHARGE_STATE→RETURNING_HOME). - Updated Q10 status trait tests to assert against the new enum member names.
- Refactored B01/Q10 code mapping tests to use
pytest.mark.parametrizefor canonical value andfrom_codemapping checks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
roborock/data/b01_q10/b01_q10_code_mappings.py |
Renames YXDeviceState members/values to be consistent with V1 naming conventions. |
tests/devices/traits/b01/q10/test_status.py |
Updates status assertions to use the renamed YXDeviceState members. |
tests/data/b01_q10/test_b01_q10_code_mappings.py |
Updates tests for canonical enum values and from_code mappings (now parameterized). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ency with V1 state values The motivation is to not have entirely different state values for the same concept to make it easier to write systems that can handle each device.
YXDeviceState enum members to have consistency with V1 state valuesYXDeviceState enum members to have consistency with V1 state values
lboue
approved these changes
Mar 22, 2026
Lash-L
approved these changes
Mar 22, 2026
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.
The motivation is to not have entirely different state values for the same concept to make it easier to write systems that can handle each device.