Skip to content

Show where an unresponsive robot was last seen, and which robots are not paired yet - #115

Open
virtitnerd wants to merge 5 commits into
DonSidro:masterfrom
virtitnerd:pr2/robot-list-status
Open

virtitnerd wants to merge 5 commits into
DonSidro:masterfrom
virtitnerd:pr2/robot-list-status

Conversation

@virtitnerd

Copy link
Copy Markdown
Contributor

This puts the robot status work in one PR: the last-known state from the server, the Not paired yet card, and the robot state names. It replaces #109 and #111 (which was stacked on #109) so they can be reviewed as one.

Depends on Python-roborock/local_roborock_server#251 (the server keeps each robot's last-known state). Without it the call fails quietly and the screens look as before.

What's in it

  • Last-known state. A GET /user/devices/{duid}/last_known client call and model. While a robot does not answer, its last map stands in on the detail screen, with where it was last seen and when.
  • Room names on the last-known map. The server keeps the robot's room table next to the last map, so the offline map shows the names set in the app instead of Room 16 and so on. The table also has each room's type, which is read but only used once the map draws room type badges.
  • Not paired yet. A robot comes from the cloud import whether or not it was ever paired to the server, so one that had never connected showed as Offline. When the server has never heard from a robot, its card says Not paired yet and tapping it opens Add vacuum with that robot already chosen, loading the list with the saved admin password. Offline keeps meaning a robot that was paired and went quiet.
  • Robot state names. Several codes showed as State N (0, 25, 30, 32 to 43, 101, 103) and two had the wrong meaning: 28 is in call, not returning to dock for drying, and 7 is remote controlling. 25 is a second code for washing the mop, and 32, the camera patrol, reads On cruise. The names come from the official app and python-roborock. A fully charged or offline robot no longer gets the pulsing active dot.

Replaces #109 and #111.

How it was tested

testDebugUnitTest and compileCommonMainKotlinMetadata pass on this branch. Unit tests cover the "last seen" text, the room table and the state names. The branch was also merged with every other open PR and the result built and tested.

virtitnerd and others added 5 commits November 12, 2026 19:38
GET /user/devices/{duid}/last_known gives the last status, battery, error and position the
server heard, and with map=1 the last map the robot sent. Adds kotlinx-datetime for showing
when.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When a robot has not answered for 10 seconds, the detail screen fetches the server's
last-known state, draws the last map it sent (with the robot's last position on it), and
says when it went offline and what it last reported. It clears itself when the robot answers.
The current time comes from the platform epoch helper, since kotlinx.datetime's
Clock.System does not resolve in common code with this kotlinx-datetime version.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A robot comes from the cloud import whether or not it was ever paired to the
server, so it showed as Offline like a robot that had dropped off. The server's
last-known state says whether it has ever heard from the robot: when it has not,
the card says Not paired yet and opens Add vacuum with that robot already chosen,
using the saved admin password to load the list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several codes showed as State N (0, 25, 30, 32 to 43, 101, 103) and two had
the wrong meaning: 28 is in call, not returning to dock for drying, and 7 is
remote controlling. 25 is a second code for washing the mop, and 32, the
camera patrol of Cruise and the pet search, reads On cruise. A fully charged
or offline robot no longer gets the pulsing active dot, and the offline
snapshot test expects the new wording.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server keeps the robot's room table next to the last map it saw, so
the offline map now shows the room names set in the app instead of
Room 16 and so on. The table also carries each room's type; it is read
but only used once the map draws room type badges.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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