Skip to content

feat(api)!: Again rename YXDeviceState enum members to have consistency with V1 state values#795

Merged
Lash-L merged 1 commit intoPython-roborock:mainfrom
allenporter:dev
Mar 22, 2026
Merged

feat(api)!: Again rename YXDeviceState enum members to have consistency with V1 state values#795
Lash-L merged 1 commit intoPython-roborock:mainfrom
allenporter:dev

Conversation

@allenporter
Copy link
Contributor

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.

Copilot AI review requested due to automatic review settings March 22, 2026 16:04
Copy link
Contributor

Copilot AI left a comment

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 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 YXDeviceState members in b01_q10_code_mappings.py to match V1-style state naming (e.g., CHARGING_STATECHARGING, TO_CHARGE_STATERETURNING_HOME).
  • Updated Q10 status trait tests to assert against the new enum member names.
  • Refactored B01/Q10 code mapping tests to use pytest.mark.parametrize for canonical value and from_code mapping 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.
@allenporter allenporter changed the title BREAKING: Again rename YXDeviceState enum members to have consistency with V1 state values feat(api)!: Again rename YXDeviceState enum members to have consistency with V1 state values Mar 22, 2026
@Lash-L Lash-L merged commit ad3ceea into Python-roborock:main Mar 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants