Skip to content

feat(v1): generalize segment clean mode updates and preserve existing settings - #1050

Draft
allenporter wants to merge 1 commit into
Python-roborock:mainfrom
allenporter:fix/customize-clean-mode-followup
Draft

allenporter wants to merge 1 commit into
Python-roborock:mainfrom
allenporter:fix/customize-clean-mode-followup

Conversation

@allenporter

@allenporter allenporter commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #984 for CustomizeCleanModeTrait:

  • Expose set_segment_clean_mode and preserve existing settings on partial updates:
    • Adds CustomizeCleanModeTrait.set_segment_clean_mode(segment, *, fan_power=None, water_box_mode=None, mop_mode=None, repeat=None, clean_then_mop=None) so V1 devices that support per-room custom modes (is_customized_clean_supported) without clean-then-mop (is_clean_then_mop_mode_supported=False, e.g. S7 MaxV, S8, Q Revo) can also configure per-room suction, water flow, route, and repeat count.
    • When updating a segment that already has an override on the device, any omitted fields preserve that room's existing values (avoiding resetting repeat=2 to 1 or requiring callers to re-supply unchanged modes). When adding an override for a room without an existing entry, fan_power, water_box_mode, and mop_mode are required and repeat defaults to 1.
    • Keeps set_clean_then_mop as a backwards-compatible wrapper with optional mode/repeat arguments.
    • Lazily refreshes before writing only when self.modes is None, relying on the post-write refresh() once loaded.
  • Reject global sentinel mode codes and invalid repeat values:
    • Rejects global status sentinel codes (CUSTOMIZED 106/204/302 and SMART_MODE 110/209/306) and repeat < 1 (or empty updates) with ValueError before sending an RPC.
  • Documentation:
    • Clarifies that the robot only applies the stored per-room table when its global cleaning mode is set to custom, and tightens comments/docstrings.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 23:23

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.

@allenporter
allenporter force-pushed the fix/customize-clean-mode-followup branch 4 times, most recently from d8bcbb9 to 389b0a3 Compare November 14, 2026 23:37
@allenporter
allenporter requested a review from Lash-L November 14, 2026 23:59
@allenporter
allenporter marked this pull request as draft November 15, 2026 04:43
@Lash-L Lash-L added Feature New feature V1 V1 platform labels Nov 15, 2026
@allenporter
allenporter force-pushed the fix/customize-clean-mode-followup branch 2 times, most recently from b1b2f07 to db4a64e Compare November 16, 2026 05:07
@allenporter
allenporter force-pushed the fix/customize-clean-mode-followup branch from db4a64e to 58f99e7 Compare November 16, 2026 05:09

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

Feature New feature V1 V1 platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants