feat: add dock strainer and cleaning brush consumable reset attributes#805
Merged
Lash-L merged 1 commit intoPython-roborock:mainfrom Apr 4, 2026
Conversation
Add STRAINER_WORK_TIMES and CLEANING_BRUSH_WORK_TIMES to ConsumableAttribute so callers can reset dock-specific consumables via reset_consumable(). The Consumable dataclass already tracks these fields; only the reset side was missing from the enum.
0fbebec to
4b810b8
Compare
Lash-L
approved these changes
Apr 3, 2026
Contributor
Author
|
thank you |
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.
Problem
The `Consumable` dataclass tracks `strainer_work_times` and `cleaning_brush_work_times` for dock-specific components, and the Home Assistant Roborock integration already exposes these as sensors (`dock_strainer_time_left`, `dock_maintenance_brush_time_left`). However, there are no reset buttons for these consumables in HA because `ConsumableAttribute` is missing the corresponding enum values — so `reset_consumable()` cannot be called for them.
The Roborock app itself supports resetting the dock strainer, which confirms the device API accepts these parameters.
Changes
Testing
All existing tests pass, and two new parametrized test cases cover the new attributes:
```
tests/devices/traits/v1/test_consumable.py::test_reset_consumable_data[strainer_work_times-strainer_work_times] PASSED
tests/devices/traits/v1/test_consumable.py::test_reset_consumable_data[cleaning_brush_work_times-cleaning_brush_work_times] PASSED
```
Related
This unblocks the Home Assistant Roborock integration from adding reset buttons for dock consumables: home-assistant/core#160121