Repository navigation
Conversation
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.
This branch has not been deployed
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.
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. Thebeginvalues are the ones inget_clean_summaryrecords. Withouttypeandidthe robot answers-10005 param error!.The response is
{"begin", "from", "num", "more", "events": [{"t", "i", "e"}]}, whereeis a JSON string. Usefromandmoreto read the next page.Event ids seen on a Saros 10R (a144)
I checked these against runs where I logged what the robot did:
ie{"2": <segment>}{"2": <segment>}{"2": <segment>}app_skip_current_cleaning_area, or the robot found the room done){"121": <code>}app_charge{"111": <from>, "112": <to>, "1": <battery>}Example: during a two-room clean,
63for the first room appeared at the same second the skip was sent, followed by43for that room and41for the next. During a live run, the last41without a following43gives 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 passedruff check,ruff format --check: cleanmypyon the changed files: clean