Add per-map rotation support with select entity and calibrated overlays#37
Open
TheHangMan97 wants to merge 6 commits intoLash-L:mainfrom
Open
Add per-map rotation support with select entity and calibrated overlays#37TheHangMan97 wants to merge 6 commits intoLash-L:mainfrom
TheHangMan97 wants to merge 6 commits intoLash-L:mainfrom
Conversation
Introduce rotation configuration constants for map image handling. Adds rotation options (0, 90, 180, 270) and dispatcher signal name.
Add SelectEntity to control map rotation per map_flag. Rotation value is persisted via RestoreEntity and stored in hass.data. Dispatcher signal notifies image entities when rotation changes.
Register SELECT platform and initialize rotation storage in hass.data. Add proper unload cleanup and reload behavior.
Implement backend image rotation using Pillow. Rotation is applied in async_add_executor_job to avoid blocking the event loop. Includes defensive validation and fallback handling.
Add English and German translations for map rotation select entity. Includes user-friendly labels for rotation options.
Add documentation for the per-map rotation select entity. Explains: - How to rotate maps (0/90/180/270) - Where to find the rotation select entity - That calibration points are rotated as well - That no reload is required Also clarifies usage with Xiaomi Vacuum Map Card.
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.
Overview
This PR adds per-map rotation support to the Roborock Custom Map integration.
Instead of handling rotation in the frontend, this implementation introduces a
dedicated Select entity per map that allows users to rotate the map image
directly within Home Assistant.
What’s new
Why this approach
Frontend-only rotation (CSS/card-mod) rotates only the rendered pixels and
does not adjust calibration or interaction coordinates.
This implementation rotates:
so overlays and interactions (rooms, zones, taps) stay aligned.
Technical details
hass.datapermap_flagRestoreEntityfor persistenceasync_add_executor_jobBackwards compatibility
Tested with