Skip to content

Harmonizes Q10 status names in python-roborock to canonical values instead of legacy *state strings#793

Merged
allenporter merged 4 commits intoPython-roborock:mainfrom
lboue:fix/normalize-q10-status-state-names
Mar 22, 2026
Merged

Harmonizes Q10 status names in python-roborock to canonical values instead of legacy *state strings#793
allenporter merged 4 commits intoPython-roborock:mainfrom
lboue:fix/normalize-q10-status-state-names

Conversation

@lboue
Copy link
Contributor

@lboue lboue commented Mar 21, 2026

Proposed change

This PR harmonizes Q10 status names in python-roborock to canonical values instead of legacy *state strings.

What changed

  • Normalized YXDeviceState values to align with the naming used across the integration:
    • sleepstatesleeping
    • standbystatestandby
    • tochargestategoing_to_charge
    • remoteingstateremote_control
    • pausestatepaused
    • faultstatefault
    • creatingmapstatecreating_map
    • mapsavestatesaving_map
    • relocationstaterelocating
    • robotsweepingsweeping
    • robotmopingmopping
    • robotsweepandmopingsweep_and_mop
    • robottransitioningtransitioning
    • robotwaitchargewaiting_to_charge
    • plus previously aligned values:
      • cleaningstatecleaning
      • chargingstatecharging
      • upgradestateupdating

Why

  • Reduces translation/state aliasing complexity downstream.
  • Keeps Q10 states consistent with existing canonical naming patterns.
  • Improves readability and avoids carrying legacy naming quirks into new Q10 support.

Tests

  • Added/updated targeted tests for Q10 status mapping.
  • Ran:
    • .venv/bin/pytest test_b01_q10_containers.py test_code_mappings.py -q
  • Result: 24 passed.

Notes

  • This is intentionally non-backward-compatible for legacy Q10 state string values, as this support is being introduced now.

@lboue lboue marked this pull request as ready for review March 21, 2026 22:52
Copilot AI review requested due to automatic review settings March 21, 2026 22:52
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 standardizes B01 Q10 device status naming by updating YXDeviceState enum string values from legacy *state labels to canonical state names, aligning Q10 status reporting with the rest of the integration.

Changes:

  • Updated YXDeviceState string values to canonical names (e.g., sleeping, standby, going_to_charge, remote_control, updating).
  • Added fault DPS mapping to Q10Status and asserted it in the existing Q10 status trait refresh test.
  • Added a dedicated container test file to lock in canonical enum values and code-to-enum mapping.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
roborock/data/b01_q10/b01_q10_code_mappings.py Renames Q10 YXDeviceState enum string values to canonical names.
roborock/data/b01_q10/b01_q10_containers.py Adds fault field to Q10Status mapped to B01_Q10_DP.FAULT.
tests/devices/traits/b01/q10/test_status.py Extends existing status refresh test coverage to include fault.
tests/data/b01_q10/test_b01_q10_containers.py New tests asserting canonical enum values and from_code() behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lboue lboue marked this pull request as draft March 21, 2026 22:57
@lboue lboue force-pushed the fix/normalize-q10-status-state-names branch from 6359df8 to 7fddf43 Compare March 21, 2026 23:02
@lboue lboue marked this pull request as ready for review March 21, 2026 23:02
@lboue lboue requested a review from Copilot March 21, 2026 23:02
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lboue lboue requested a review from allenporter March 21, 2026 23:32
@allenporter allenporter merged commit dce00a2 into Python-roborock:main Mar 22, 2026
7 checks passed
@lboue lboue deleted the fix/normalize-q10-status-state-names branch March 22, 2026 09:01
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.

3 participants