Skip to content

fix(v1): give VacuumModes.OFF a distinct code from GENTLE - #1066

Open
saruk-vedant wants to merge 9 commits into
Python-roborock:mainfrom
saruk-vedant:roborock-999-vacuum-modes-distinct-codes
Open

saruk-vedant wants to merge 9 commits into
Python-roborock:mainfrom
saruk-vedant:roborock-999-vacuum-modes-distinct-codes

Conversation

@saruk-vedant

Copy link
Copy Markdown
Contributor

Summary

VacuumModes.GENTLE and VacuumModes.OFF shared code 105, so code lookups were ambiguous: from_code(105) always returned GENTLE and both members equalled 105. This applies the same distinct-value pattern used for WaterModes: OFF now keeps its own code (107) while GENTLE keeps 105.
105 stays the wire code: the app sends 105 (CleanModeZero) for mop-only cleaning, so OFF has no wire code of its own. A new vacuum_mode_wire_code() helper translates OFF back to 105 at the boundaries that send codes to the device or map reported codes to names (get_cleaning_mode_parameters, set_clean_then_mop, fan_speed_mapping), and _resolve_clean_mode still resolves a reported 105 by device capability (OFF on pure-mop devices, GENTLE otherwise).

How to test

  • uv run pytest tests/data/v1/test_v1_clean_modes.py tests/devices/traits/v1/test_status.py tests/devices/traits/v1/test_customize_clean_mode.py tests/conformance/test_enum_conformance.py (472 passed, 53 xfailed, including 8 new tests)
  • uv run pytest (2369 passed, 11 deselected, 53 xfailed; base commit 2361 passed, so +8 new tests, no failures)
  • uv run ruff check roborock tests and uv run ruff format --check roborock tests (clean)
  • uv run mypy roborock tests (same 20 pre-existing errors as the base commit; no new errors)
  • No real hardware was available, so the wire behavior (105 still sent and reported for mop-only cleaning) is verified by tests pinning the literal wire code.
    Fixes VacuumModes.GENTLE and VacuumModes.OFF share value 105 #999

Copilot AI balanced review requested due to automatic review settings November 18, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

VacuumModes.GENTLE and VacuumModes.OFF share value 105

2 participants