Skip to content

feat: add V1 mop wash settings - #1045

Draft
infy1995 wants to merge 6 commits into
Python-roborock:mainfrom
infy1995:feat/v1-mop-wash-settings
Draft

infy1995 wants to merge 6 commits into
Python-roborock:mainfrom
infy1995:feat/v1-mop-wash-settings

Conversation

@infy1995

Copy link
Copy Markdown
Contributor

Part of the "Dock controls" item in #738: V1 dock mop wash settings and the wash tray self-clean.

Depends on #1036 (this branch is based on it; the first two commits belong to #1036). I will rebase onto main once #1036 is merged.

Changes

  • New WashWaterTemperatureTrait (PropertiesApi.wash_water_temperature)
    • Reads get_wash_water_temperature; set_wash_water_temperature(temperature) sends set_wash_water_temperature with {"values": <code>}. The device answers reads with wash_water_temperature, but rejects that key on writes (-10007 invalid params).
    • New RoborockDockWashWaterTemperatureCode: room_temperature 0, warm 1, hot 2, steam 3, pet_steam 4.
    • wash_water_temperature_options from the pure get_wash_water_temperatures(dock_features): room temperature and hot always, warm on high temperature docks and docks without steam, steam only on steam docks, pet steam never.
    • Created only for washing docks on devices with is_hot_wash_towel_supported, so docks that cannot heat wash water get no temperature control.
  • New CleaningFluidTrait (PropertiesApi.cleaning_fluid), the app's cleaning fluid auto-delivery
    • Reads get_auto_delivery_cleaning_fluid; set_cleaning_fluid(mode) sends set_auto_delivery_cleaning_fluid with {"status": <code>}.
    • New RoborockDockCleaningFluidCode: off 0, standard 1, large 3. Code 2 is not used by the app.
    • Gated by dock_features.is_clean_fluid_auto_delivery_supported.
  • SmartWashParamsTrait (the app's mop wash frequency)
    • SmartWashParams.smart_wash is now RoborockDockSmartWashModeCode | None (by_time 0, by_room 1, new_smart 2) instead of int | None. It is an IntEnum, so integer comparisons keep working.
    • smart_wash_mode_options: by time and by room, plus new smart with is_back_wash_new_smart_supported. wash_interval_options: 600, 900, 1200, 1500 s.
    • set_smart_wash_params(mode, wash_interval) sends both values together.
    • The trait now takes DeviceFeaturesTrait and is created in discover_features(), like WashTowelModeTrait.
  • WashTowelModeTrait
    • set_wash_towel_mode(mode) now rejects a mode outside wash_towel_mode_options before sending.
    • New self_clean_tray() sends app_amethyst_self_check, gated by dock_features.is_clean_carousel_self_clean_supported. stop_wash() stops a running self-clean early, like the stop button in the app.
  • All setters raise RoborockUnsupportedFeature for a value the device does not offer, send nothing in that case, and update the trait state only after the command succeeds.
  • docs/V1_API_COMMANDS.md: entries for the new commands and formats, get/set_smart_wash_params codes, set_wash_towel_mode codes, app_amethyst_self_check.

Wire formats

Setting Read / write Codes
Wash water temperature get_wash_water_temperature → {"wash_water_temperature": n}; set_wash_water_temperature {"values": n} 0 room temperature, 1 warm, 2 hot, 3 steam, 4 pet steam
Cleaning fluid auto-delivery get/set_auto_delivery_cleaning_fluid, {"status": n} 0 off, 1 standard, 3 large
Mop wash frequency get/set_smart_wash_params, {"smart_wash": n, "wash_interval": s} 0 by time, 1 by room, 2 new smart; interval 600/900/1200/1500 s
Wash water amount get/set_wash_towel_mode, {"wash_mode": n} 0 light, 1 balanced, 2 deep, 8 super deep, 10 smart (existing WashTowelModes)
Tray self-clean app_amethyst_self_check, no params; stopped by app_stop_wash

Codes, option lists and write formats come from the Roborock app's V1 device plugins, and were confirmed on a Saros 10R (roborock.vacuum.a144, dock type 16).

Behavior changes for consumers

  • set_wash_towel_mode() now raises RoborockUnsupportedFeature for a mode outside wash_towel_mode_options. Callers that pick from that list (as Home Assistant does) are unaffected.
  • SmartWashParams.smart_wash is an enum instead of a plain int (see above).

Testing

  • uv run pre-commit run --all-files: all hooks pass.
  • uv run pytest: 2489 passed. Each commit passes on its own.
  • New and extended tests in tests/devices/traits/v1/ (test_wash_water_temperature.py, test_cleaning_fluid.py, test_smart_wash_params.py, test_wash_towel_mode.py): option lists, setter commands, rejection of unoffered values without sending, state unchanged after a failed command, unknown firmware codes, trait availability per dock type and per hot wash feature.
  • Saros 10R:
    • Read: temperature 2 (hot), fluid 1 (standard), smart wash by room / 1200 s, wash mode smart.
    • Write: temperature warm and room temperature, fluid large and off, mop wash by time every 15 min, wash mode light, balanced and deep, each set through the library and confirmed in the Roborock app; then restored.
    • Tray self-clean: after self_clean_tray() the robot state went from charging to washing_the_mop (wash_phase 11) and the app showed the self-clean; stop_wash() ended it within 3 s, with the same status changes as the stop button in the app.

@infy1995
infy1995 marked this pull request as draft November 13, 2026 20:13

This branch has not been deployed

No deployments
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.

1 participant