Repository navigation
Conversation
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.
What
Two fixes for how V1 data protocol pushes update the status trait:
water_box_modethat the slider cannot name is ignored. The robot pushes the old level codes (201/202/203, and 208 for the top of the slider), whileget_statusreturns slider codes (200, 221-250). Storing the pushed code leftwater_mode_nameasNone("unknown") until the next poll. Codes 200, 204, 209 and 221-250 are still applied, and devices without a water slider are unchanged.fan_powerorwater_box_mode,PropertiesApireads the status back once, about one second later (StatusTrait.refresh_and_notify()). Status listeners are notified only if the status changed. This corrects the water level andmop_modeshortly after a mode change made elsewhere (for example leaving SmartPlan or switching vacuum and mop to vacuum), whichmop_modenever gets from a push.Why
Measured on a Saros 10R: after changing water in the Roborock app, Home Assistant showed "unknown" for a few seconds, and the cleaning mode stayed stale after a mode change. Push log:
124=202was followed by aget_statusthat returned 235,124=203by 246.Behavior notes
fan_powerorwater_box_modecause no request.PropertiesApi.close()cancels pending and running read-backs. ARoborockExceptionfrom the read-back is logged and does not stop later ones.tests/devices/traits/v1/test_status.pyand intests/devices/traits/v1/test_init.py(new, the mirror file fortraits/v1/__init__.py; nothing covered the push handler before).Conflicts with open PRs
Test-merged with every open PR that touches the same files:
tests/devices/traits/v1/test_status.pyonly (new tests appended in the same place). No conflict in code. Whichever merges second rebases and keeps both sets of tests. feat(v1): expose clean-then-mop status from the device #959 and feat(v1): offer SmartPlan and custom modes in the cleaning mode options #1055/feat(v1): add fan speed, water and mop route setters that refuse changes in SmartPlan and custom mode #1064 also touchstatus.pynearupdate_from_dpswithout a text conflict.Checks
uv run pre-commit run --all-files(ruff, mypy, codespell) passes, andtests/devicespasses (961 tests).