Skip to content

fix: align mop routes with device capabilities - #918

Merged
allenporter merged 2 commits into
mainfrom
fix-s6-maxv-mop-route-clean
Aug 15, 2026
Merged

fix: align mop routes with device capabilities#918
allenporter merged 2 commits into
mainfrom
fix-s6-maxv-mop-route-clean

Conversation

@Lash-L

@Lash-LLash-L commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • gate mop-route options and mop_mode payloads on the combined clean-route capability used by the Roborock app (runtime shake, model shake/spin, or roller mop)
  • omit Deep/301 when clean-efficiency support is present
  • use Deep Plus CN/305 only for China devices with deep-slow-plus support and without corner-clean support; otherwise use 303
  • keep the public route label as deep_plus for both protocol variants

RR_API validation

Checked all 24 captured app bundles and compared the route builder in all 11 route-capable V1 bundles. The 10 newer bundles consistently gate 301 on the inverse of clean-efficiency support. Tanos combines the runtime shake bit, model Mop_ShakeModule/Mop_SpinModule, and roller-mop support; this preserves valid routes for spin-mop devices such as PEARLSLITE when the runtime shake bit is false.

Validated fixture and synthetic matrices for S6 MaxV, S7, PEARLSLITE, TOPAZSV, Saros 20, US/CN regions, roller bit boundaries, and every branch of the 303/305 selection.

Tests

  • uv run pytest tests/devices/traits/v1/test_status.py tests/test_supported_features.py -q (111 passed)
  • broad deterministic suite with coverage (903 passed; Windows-incompatible MQTT select.select fixture modules excluded locally and left to Linux CI)
  • uv run ruff check .
  • uv run ruff format --check .
  • uv build

Addresses the route-selection problem discussed in home-assistant/core#178659 (comment) and preserves the S6 MaxV fix from home-assistant/core#177324.

@Lash-L
Lash-L requested review from allenporter and a lite review from CopilotAugust 12, 2026 14:16
@codecov

codecovBot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing linesCoverage Δ
roborock/data/code_mappings.py91.22% <100.00%> (+0.86%)⬆️
roborock/data/v1/v1_clean_modes.py93.26% <100.00%> (+4.54%)⬆️
roborock/device_features.py97.84% <100.00%> (+0.01%)⬆️
roborock/devices/traits/v1/status.py97.05% <100.00%> (ø)
tests/data/test_code_mappings.py100.00% <100.00%> (ø)
tests/devices/traits/v1/test_status.py99.09% <100.00%> (+0.19%)⬆️
tests/test_supported_features.py100.00% <100.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

CopilotAI 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.

Pull request overview

This PR adjusts how V1 “clean route” / mop-route capability is detected and surfaced, aiming to close a support gap by incorporating the runtime shake-mop feature bit into feature detection and the route/payload logic.

Changes:

  • Extends DeviceFeatures to treat is_clean_route_setting_supported as inclusive of the runtime is_shake_mop_set_supported flag.
  • Updates V1 clean-route option derivation and cleaning-mode RPC payload construction to key off the shake-mop support flag.
  • Adds/updates tests and snapshots to validate new capability detection and mop-route option behavior.

Reviewed changes

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

Show a summary per file
FileDescription
tests/test_supported_features.pyAdds assertions and new parametrized tests for shake-mop bit and clean-route setting support.
tests/devices/traits/v1/test_status.pyUpdates status-trait tests to reflect mop-route options behavior based on shake-mop support.
tests/devices/snapshots/test_v1_device.ambrUpdates snapshots for status trait output after mop-route gating changes.
tests/snapshots/test_supported_features.ambrUpdates snapshots for feature-flag support output.
roborock/device_features.pyORs runtime shake-mop support into clean-route setting support.
roborock/data/v1/v1_clean_modes.pyGates mop-route options and mop_mode payload inclusion based on shake-mop support.
Suppressed comments (1)

roborock/data/v1/v1_clean_modes.py:289

  • get_cleaning_mode_parameters() switched from is_clean_route_setting_supported to is_shake_mop_set_supported for deciding whether to include mop_mode in the RPC payload. This can omit mop_mode for devices where clean-route support is inferred from the model’s shake/spin capability (or when new_feature_info is unavailable), which risks sending an incomplete payload for mop-capable devices.
 fan_power, water_box_mode, mop_mode = _get_clean_motor_mode_params(cleaning_mode, features)
params: dict[str, int] = {"fan_power": fan_power.code, "water_box_mode": water_box_mode.code}
if features.is_shake_mop_set_supported:
params["mop_mode"] = mop_mode.code
return [params]

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 135 to +140
def get_clean_routes(features: DeviceFeatures, region: str) -> list[CleanRoutes]:
"""The routes that the vacuum will take while mopping"""
# Mop routes are only configurable when the device advertises support for
# setting the shake-mop route.
if not features.is_shake_mop_set_supported:
return []
Comment threadroborock/device_features.py Outdated
Comment on lines +647 to +650
# Clean-route setting support is provided by either the runtime
# shake-mop flag or the model's shake/spin mop capability.
kwargs["is_clean_route_setting_supported"] |= kwargs["is_shake_mop_set_supported"]

@Lash-L
Lash-Lforce-pushed the fix-s6-maxv-mop-route-clean branch from c3958a2 to 1f4b45cCompareAugust 13, 2026 14:20
@Lash-LLash-L changed the title fix: fix support gap for the clean route logicfix: align mop routes with device capabilitiesAug 13, 2026
@Lash-L
Lash-Lforce-pushed the fix-s6-maxv-mop-route-clean branch from 1f4b45c to 8b057e5CompareAugust 13, 2026 14:38
@allenporter
allenporter merged commit 5120fbd into mainAug 15, 2026
8 checks passed
Sign up for freeto 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

@Lash-L@allenporter