Skip to content

feat: add GET_CLEAN_DETAIL and GET_RT_CLEAN_DETAIL commands - #1063

Open
cptntrps wants to merge 1 commit into
Python-roborock:mainfrom
cptntrps:feat/clean-detail-commands
Open

cptntrps wants to merge 1 commit into
Python-roborock:mainfrom
cptntrps:feat/clean-detail-commands

Conversation

@cptntrps

Copy link
Copy Markdown

Summary

Adds two V1 commands for the clean timeline:

  • GET_RT_CLEAN_DETAIL (get_rt_clean_detail), params {"type": 0, "from": <offset>}: the event timeline of the current run, or of the last run when the robot is idle.
  • GET_CLEAN_DETAIL (get_clean_detail), params {"begin": <run begin>, "type": 0, "id": 0, "from": <offset>}: the same for a past run. The begin values are the ones in get_clean_summary records. Without type and id the robot answers -10005 param error!.

The response is {"begin", "from", "num", "more", "events": [{"t", "i", "e"}]}, where e is a JSON string. Use from and more to read the next page.

Event ids seen on a Saros 10R (a144)

I checked these against runs where I logged what the robot did:

i e Meaning
41 {"2": <segment>} room started
43 {"2": <segment>} room finished
63 {"2": <segment>} room left early (app_skip_current_cleaning_area, or the robot found the room done)
12 {"121": <code>} task ended: 14 finished, 123 stopped by app_charge
11 {"111": <from>, "112": <to>, "1": <battery>} state change

Example: during a two-room clean, 63 for the first room appeared at the same second the skip was sent, followed by 43 for that room and 41 for the next. During a live run, the last 41 without a following 43 gives the room in progress.

This PR adds only the commands. A typed trait could come later, once more models confirm the event ids.

Checks

  • uv run pytest: 2363 passed
  • ruff check, ruff format --check: clean
  • mypy on the changed files: clean

get_rt_clean_detail returns the event timeline of the current or last run;
get_clean_detail returns it for a past run, selected by its begin time.
@Lash-L Lash-L added Small PR Small pull request (<200 lines) Data model changes Changes to data models, device info, or feature mappings Feature New feature V1 V1 platform labels Nov 18, 2026

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

Data model changes Changes to data models, device info, or feature mappings Feature New feature Small PR Small pull request (<200 lines) V1 V1 platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants