client.py
client.py copied to clipboard
Align viewbox center with vacuum map center
This is an alternative approach for supporting the Vacuum Map card calibration from https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/issues/321. This will make the calibration much simpler. Object coordinates inside the SVG are vacuum coordinates divided by 50 with y axis flipped. That information, combined with the viewbox, will be enough to translate the vacuum coordinates to a position on even a scaled image on the frontend.
This has the benefit over my previous PR of not changing the interface. The calibration points can be static and added outside of this library.
Summary by CodeRabbit
-
Refactor
- Improved map manipulation logic for better performance and maintainability.
-
Tests
- Updated test cases to align with refactored map manipulation functions.