-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add possibility to list maps, zones and to clean only a certain zone #8
Comments
Added (Simple) ability to list maps and zones for API v1 in commit a8a26f7
|
Cleaning a specific zone is possible since f459fc2 on the v2 API, but this one lacks getting map images |
Also implemented for v1 in f5088f7 |
It would be awesome to be able to download map images for v2 API. Is there anything I can do to help? Thanks for your hard work. |
I checked again, but there are no images in the classic sense anymore (The old API had server-generated png's). It's some kind of json which needs to be plotted. I added some code if you really want to look at it: https://github.com/Phype/purei9_unofficial/blob/master/src/purei9_unofficial/cloudv2.py#L273 Its 8KByte of gzipped json which looks like this:
Even if we could plot it, i'm unsure if it makes sense to put effort into this given that they changed the app and API once again, so any work has to be re-done in some months. |
Interesting. When time allows it, I'm going to play around a bit and see if I can't throw this into an SVG and hopefully generate something useful. Not going to spend a lot of time on it since, as you mention, it might be in vain if they change it. Still, can be a fun project for me. 🙂 |
I've had a chance to play around with plotting the map data and managed to get some reasonable results. Once I've made my code a bit more robust, I'll create a PR. Findings so far:
(edited to fix formatting, image not rendering and correct formula) |
Here's a preview of the mapping comparing the map drawn by the Electrolux One app and the mapping that I'm working on: It's not ready for a pull request but you can preview the work here: https://github.com/louisjennings/purei9_unofficial/blob/871b17aaa54b62d3c2e266d347f4b077d90b7b62/src/purei9_unofficial/plot_map.py |
Great working! I'm excited about the results and the ability to implement this in Home Assistant. 🙂 |
@louisjennings great work! Assuming we can draw the map, the qeustion @Ekman would be what format it should ideally be in for homeassistand to display it? Just some Options:
|
I've added some code using PIL (because i think having a dependency on matploitlib wouln't be great) into the image branch which comes out pretty good i think: CloudMap.getImage() returns a byte array containing a PNG whoch can be displayed. For integration in homeassistant, i thing the vaccuum integration seems to have a TODO: For me this the code works, but it doesn't show the correct map. In the end we would probably want to display the map from the last run, not the stroed "Map" which is used to define Clening and Avoid zones. |
I'll make it work as long as it's an image. I'm a huge fan of SVG since it's so lightweight, but any format works really. 🙂 It was a while ago that I studied other vacuum integrations, but if I remember correctly then the camera is the way to go. |
✅ List maps
✅ List zones
📋 Add possibility to pass a zone to the clean command
The text was updated successfully, but these errors were encountered: