Repository navigation
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
V1TraitMixinexpects a setter to leave the trait's own state current, either by updating it optimistically or by refreshing. The other V1 setters, such aschild_lock,led_status,mop_dryerandvolume, do this.Problem
WashTowelModeTrait.set_wash_towel_mode()sendsset_wash_towel_modebut does not updatewash_mode. After a successful set the trait keeps reporting the previous mode until the nextrefresh().Changes
wash_modeoptimistically after the command, using the same idiom as the switch traits.Testing
test_set_wash_towel_modenow also asserts the trait state. The new assertion fails on unchanged code.main.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):get_wash_towel_modereturned the new value, butwash_modestill held the previous one.The original mode was restored afterwards.