Skip to content

feat(v1): add dock strainer and cleaning brush consumable fields - #1088

Merged
allenporter merged 1 commit into
Python-roborock:mainfrom
hCoureau:submit/feat/dock-consumable-fields
Nov 24, 2026
Merged

allenporter merged 1 commit into
Python-roborock:mainfrom
hCoureau:submit/feat/dock-consumable-fields

Conversation

@hCoureau

@hCoureau hCoureau commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds two members to ConsumableField:

  • STRAINER_WORK_TIME (strainer_work_times)
  • CLEANING_BRUSH_WORK_TIME (cleaning_brush_work_times)

The matching Consumable fields now carry dock_feature metadata, so DeviceFeaturesTrait.is_field_supported(ConsumableTrait, field) answers from the dock type:

Field Gate (RoborockDockFeatures) Supported on
strainer_work_times is_strainer_supported (new: is_clean_carousel_supported or is_only_x_series) carousel docks (Pearl, Couple, Hera, Shell except Shell 4R, K1, F-series) and X-series docks
cleaning_brush_work_times is_cleaning_brush_supported X-series docks (o2, o3, o3_plus, o4, o5, o6, o7, o7h)

Other changes:

  • The ConsumableField docstring now says fields are gated by either dps or dock_feature metadata.
  • The ConsumableTrait docstring now points callers at is_field_supported instead of checking for non-None values.
  • docs/V1_DEVICE_FEATURES.md documents is_strainer_supported.

Why a new strainer property

is_washable was too broad: it reported a strainer on Shell 4R (dock type 32), which the app's carousel list excludes. Gating directly on is_clean_carousel_supported would also drop every X-series dock, since the app-derived docs list none of them as carousel docks. The evidence on X-series docks is inconclusive. The app shows the carousel consumable only on non-O-series docks, but the get_consumable example in docs/V1_API_COMMANDS.md reports strainer_work_times next to cleaning_brush_work_times, and earlier releases reported a strainer on every wash dock. So is_strainer_supported takes the union. Compared with is_washable, only Shell 4R changes. If someone confirms that X-series docks have no strainer, the is_only_x_series term can be removed.

Why

get_consumable returns both counters on many devices, and ConsumableAttribute can already reset them. But callers had no way to ask whether the device actually has a strainer or cleaning brush, so they had to repeat the dock capability checks themselves. This uses the same dock_feature mechanism that StatusV2 already uses for clear_water_box_status and similar fields.

Testing

  • The test_is_consumable_field_supported snapshot (tests/devices/traits/v1/__snapshots__/test_device_features.ambr) covers both new fields for every V1 device fixture. Examples: Qrevo 2 Pro (f1_dock) reports strainer supported and cleaning brush unsupported; S7 MaxV (o3_plus_dock) reports both supported; Q5 Max (o1_dock, collect only) reports neither.
  • New parametrized test_is_dock_consumable_field_supported checks is_field_supported per dock type, including a Shell 4R negative case for the strainer. That case fails with the earlier is_washable gating.
  • uv run pytest -n auto, ruff check and ruff format --check all pass. mypy shows only the existing tests/map/test_b01_q10_render.py:502 error that is already on main.
  • Not tested on hardware.

🤖 Generated with Claude Code

Callers had to check dock capabilities themselves to know whether a
device has a dock strainer or cleaning brush to report and reset.
ConsumableField now includes STRAINER_WORK_TIME and
CLEANING_BRUSH_WORK_TIME, so is_field_supported answers this from the
dock type.

The strainer is gated on a new RoborockDockFeatures.is_strainer_supported
(carousel docks or O-series docks), which excludes Shell 4R. The
cleaning brush is gated on is_cleaning_brush_supported (O-series docks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hCoureau
hCoureau force-pushed the submit/feat/dock-consumable-fields branch from 806ae85 to e8c0e2a Compare November 23, 2026 23:32
@allenporter
allenporter merged commit ab8f122 into Python-roborock:main Nov 24, 2026
9 checks passed
@hCoureau
hCoureau deleted the submit/feat/dock-consumable-fields branch November 26, 2026 22:47
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