Hypfer / lovelace-valetudo-map-card

Display the map from a valetudo-enabled robot in a home assistant dashboard card.
MIT License
243 stars 36 forks source link

Add support for multiple path entities #100

Closed Hypfer closed 2 years ago

Hypfer commented 2 years ago

Depending on the robot, there can be multiple PathEntities since https://github.com/Hypfer/Valetudo/commit/e083af2759f37706cda1e45a0b083b0782112f3b

As it is implemented now, the render code of the card seems to assume that there's only a single path.

For testing a Map JSON with multiple paths can be found here: https://raw.githubusercontent.com/Hypfer/Valetudo/e083af2759f37706cda1e45a0b083b0782112f3b/backend/test/lib/DreameMapParser/z10_1056_paths.json

It might make sense to use this opportunity to switch to SVG-based paths. See code here: https://github.com/Hypfer/Valetudo/blob/e083af2759f37706cda1e45a0b083b0782112f3b/frontend/src/map/PathSVGDrawer.ts

TheLastProject commented 2 years ago

Well, this would be super easy to add in general. Going to mark this as "good first issue" because I have too many projects but if nobody does it soon-ish I will probably do it myself

szafran81 commented 2 years ago

@TheLastProject have you been able to take a look at that, or still too busy for now ? (not complaining, just asking)

TheLastProject commented 2 years ago

It is more that it is a super trivial change for a device I don't own (so I can't test it) so it makes more sense for someone that owns the device to change it. But given nobody seems to care enough to fix it themselves I will spend 10 minutes on it tonight and hope I will get it right first try (given I can't test it)

TheLastProject commented 2 years ago

Fixed in ff234ece0290c47473c30b809367f146bfe54270