-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the calibration matrix based on SVG viewbox #715
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since HA 2024.2 the custom component is merged into the cores Ecovacs integration and I will archive the custom component soon. I think this file needs to be renamed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any functional changes related to this card because of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No the migration itself has no functional changes.
With the release of 3.1.0 the integration switched from png to SVG and that change can caused some functional changes. As I don't use your card, I completely forgotten to test it.
The core integration uses also the SVG image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do I need to make some changes? In either PR? Or just be patient?
Not really sure why that check is failing. |
Don't worry about it :) |
Did some more tests and found that it didn't work as expected in Chrome. Couldn't find a good way to check if image is SVG without loading it in an object tag. Checking naturalWidth == 0 only works on Firefox. Decided instead to add a flag for the deebot platform that enables this additional SVG logic. Other platforms should be more or less unchanged. |
134a577
to
109ce76
Compare
This is my attempt to make the card correctly calibrate the map to vacuum coordinates for Ecovacs.
After the changes in DeebotUniverse/client.py#433 that align the center of the vacuum map and svg generated it is a simple matter of setting the correct scale (1/50), flipping y and then offsetting the map coordinates by the viewbox.
As far as I could figure out, there is no way to get any of the SVG metadata from an img tag, that's why I added an object next to it. If you like I could add it only for ecovacs vacuums.
I had some issues introducing this change without creating an (almost) endless rendering loop, but I think I've finally gotten it sorted out.