Replies: 2 comments 2 replies
|
Interesting idea. What happens if has_newmap is 1 and the user does nothing? Will the robot auto-decide yes after a while? |
2 replies
|
There's a much better way to implement this now: https://github.com/Hypfer/Valetudo/blob/master/backend/lib/core/capabilities/PendingMapChangeHandlingCapability.js See also the Dreame implementation which raises the event Valetudo/backend/lib/robots/dreame/DreameValetudoRobot.js Lines 121 to 135 in 741c711 and handles the actions: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
While Viomi doesn't have a full-fledged snapshot capability, it does occasionally decide that it might have screwed up the map completely and ask the user what to do.
When this happens it will set the status value
has_newmapto 1, temporarily keep the new map but allow reverting to the old one (or making it permanent) with theset_newmapcommand.I'd like to adapt the MapSnapshotCapability to this behavior by reporting two fake snapshots when
has_newmap, "Current" and "Previous". For the current map I'd pass the actual current map, and the fake "NO MAP DATA" map for the previous one since there's no way to retrieve it without permanently reverting to it.The date can either be fake or I can store the date the new map has first appeared in
ephemeralState, I'll see what's feasible.If
has_newmapis 0 I'd return 0 snapshots.I think this should be okay since if the map is screwed up the user will likely try to browse around and see if they can undo it, find the option and go back to the old map.
For reference, when this situation occurs, the official app will show a dialog: "New map available. Do you want to save it?" with "yes"/"no" buttons.
All reactions