Repository navigation
Conversation
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.
Adds the robot position to the image entity's attributes, next to
calibration_points,roomsandzones:Why
The coordinator already refreshes the map, with the robot position in it, about every 30 s while cleaning. But no entity exposes that position. The only way to read it is the core
roborock.get_vacuum_current_positionaction, which fetches the map again on every call. A card that follows the robot therefore doubles the cloud map requests, once per open screen.With the attribute, a card reads the position from state and makes no extra request. It uses native map coordinates, like
roomsandzones, so the consumer appliescalibration_pointsitself.vacuum_positionis also the attribute name that xiaomi-vacuum-map-card already reads, as Xiaomi Cloud Map Extractor exposed it.This is a lighter take on the use case in #49 (robot position for a 3D floor plan overlay). It does not add the cleaning path, so no large arrays go into state or the recorder.
Testing
Ran on HA with a Roborock S7: after a restart,
image.<map>_customshowsvacuum_positionmatchingroborock.get_vacuum_current_positionat the dock. A 3D floor plan card follows the attribute instead of calling the action. Not yet checked during a full cleaning run.