Closed simontegelid closed 2 years ago
@stianaske what do you think of this?
So basically start_cleaning() with category 4 will fail on a device that supports persistent maps if no persistent maps have been stored. Is that correct?
So basically start_cleaning() with category 4 will fail on a device that supports persistent maps if no persistent maps have been stored. Is that correct?
Yes, correct. I have a workaround on my side to call "neato.custom_cleaning" to enforce category 2 because the category 4 (from vacuum.start) is failing with a "Failed to load map" error (or something like that, can't recall the exact formulation).
Are you waiting for me to do anything or can we merge this?
Bump Ping Hello? 🙂
Are you waiting for me to do anything or can we merge this?
Sorry, missed this.
Simplified the logic as mentioned before merging.
Just looking for a key in a dict, which will always be there, isn't sufficient to determine whether a robot has persistent maps or not. The persistent maps endpoint seem to return empty lists if a robot doesn't have maps, and also the string persistent_maps as a trait. Look for these to determine whether a robot has persistent maps or not.
I have a D5 and a D7 which I recently rearranged and removed the persistent maps from, which caused the
robot.start_cleaning()
to break. I figured that it was because of the automatic category selection going wrong because of the robot.has_persistent_maps always being true. The account.persistent_maps dict looked like this:I created a new persistent map for the D7 today, and now the above dict looks like:
I also noted that the
traits
list includes thepersistent_maps
if a map exists for the robot:D7 with map:
D5 w/o map:
With this PR, the
robot.start_cleaning()
sends this:D7 with map:
D5 w/o map: