Skip to content

fix(v1): update wash towel mode after setting it - #1060

Open
hCoureau wants to merge 1 commit into
Python-roborock:mainfrom
hCoureau:submit/fix/wash-towel-mode-local-state
Open

hCoureau wants to merge 1 commit into
Python-roborock:mainfrom
hCoureau:submit/fix/wash-towel-mode-local-state

Conversation

@hCoureau

Copy link
Copy Markdown
Contributor

Context

V1TraitMixin expects a setter to leave the trait's own state current, either by updating it optimistically or by refreshing. The other V1 setters, such as child_lock, led_status, mop_dryer and volume, do this.

Problem

WashTowelModeTrait.set_wash_towel_mode() sends set_wash_towel_mode but does not update wash_mode. After a successful set the trait keeps reporting the previous mode until the next refresh().

Changes

Testing

  • The existing test_set_wash_towel_mode now also asserts the trait state. The new assertion fails on unchanged code.
  • 2,361 tests passed on each of Python 3.11 and 3.14, on current main.
  • pre-commit, commitlint and source/wheel builds passed.

Evidence

On a Qrevo 2 Pro (roborock.vacuum.a294, firmware 02.40.54), for each wash mode the library offers on this device (light 0, balanced 1, deep 2, super_deep 8):

  • Before this change, the dock accepted the set and get_wash_towel_mode returned the new value, but wash_mode still held the previous one.
  • With this change, the same run reports the new mode locally after each set.

The original mode was restored afterwards.

WashTowelModeTrait.set_wash_towel_mode sent the command but left wash_mode
unchanged, so the trait kept reporting the previous mode until the next
refresh. Update wash_mode optimistically after the command, like the other
V1 trait setters.
@Lash-L Lash-L added Small PR Small pull request (<200 lines) bug Something isn't working V1 V1 platform labels Nov 18, 2026

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

bug Something isn't working Small PR Small pull request (<200 lines) V1 V1 platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants