Skip to content

feat: add dock strainer and cleaning brush consumable reset attributes#805

Merged
Lash-L merged 1 commit intoPython-roborock:mainfrom
CSdread:feat/add-dock-consumable-reset-attributes
Apr 4, 2026
Merged

feat: add dock strainer and cleaning brush consumable reset attributes#805
Lash-L merged 1 commit intoPython-roborock:mainfrom
CSdread:feat/add-dock-consumable-reset-attributes

Conversation

@CSdread
Copy link
Copy Markdown
Contributor

@CSdread CSdread commented Apr 3, 2026

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

  • Added `STRAINER_WORK_TIMES = "strainer_work_times"` to `ConsumableAttribute`
  • Added `CLEANING_BRUSH_WORK_TIMES = "cleaning_brush_work_times"` to `ConsumableAttribute`
  • Extended the parametrized `test_reset_consumable_data` test to cover both new attributes

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

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.
@CSdread CSdread force-pushed the feat/add-dock-consumable-reset-attributes branch from 0fbebec to 4b810b8 Compare April 3, 2026 17:21
@Lash-L Lash-L merged commit aa2691a into Python-roborock:main Apr 4, 2026
7 checks passed
@CSdread
Copy link
Copy Markdown
Contributor Author

CSdread commented Apr 4, 2026

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants