alexkn / node-red-contrib-valetudo

A Node-RED node to convert Valetudo map_data to a png image wich can be send to a dashboard template node.
Apache License 2.0
14 stars 2 forks source link

Path is never drawn (Dreame D9, Valetudo 2022.05) #23

Closed jonasc closed 2 years ago

jonasc commented 2 years ago

Robot: Dreame D9 Valetudo 2022.05

Thanks for the nice flow! I started using it for the first time with my Dreame D9 and noticed that the path is never drawn. It does not matter whether I enable or disable the "Draw Path" option. All other options (draw robot, draw charger, scale) do work (I did not check cropping as I don't need it).

Could it be that this has to do with Dreame using multiple paths instead of a single one, see https://github.com/Hypfer/Valetudo/releases/tag/2021.11.1 under "Bugfixes" > "Dreame paths".

alexkn commented 2 years ago

Yes, it will only draw the first path entity.

https://github.com/alexkn/node-red-contrib-valetudo/blob/690ecddf1a0c33122b44a6c06d459ac10bdbee30/lib/MapDrawer.js#L69-L73

jonasc commented 2 years ago

Okay, thanks for confirming this. So this could probably be solved by iterating over all path objects instead of just finding the first, right? My JavaScript / NodeJS skills are very basic; otherwise I would just submit a pull request.

alexkn commented 2 years ago

should be fixed in v3.1.1

jonasc commented 2 years ago

It works like a charm! Thanks a lot for the quick fix and your work on the node!