PiotrMachowski/lovelace-xiaomi-vacuum-map-card

Suggestion: Background "temp" image while loading the map

thedmmatt opened this issue · 0 comments

Description

Since my vacuum map extractor is already set to auto_update: false to avoid bombarding Xiaomi's API server (which would block further connections to extract the map), I was wondering if the map card could be automated to show the last snapshot the extractor received.

I know this forum is for the map card, not the extractor, but I do believe it could be handled by the map card itself.

Solution

I managed to do this using some triggers (such as docking or cleaning), so the automation would take a snapshot whenever that state changed. Then in the map card, I used JS and CSS to identify whenever the camera was still loading to display the last snapshot over it.

The issue is that this approach starts to be faulty sometimes, especially when the device screen ratio dislocates the image. However, I noticed that the #shadow-root element can be tempered during a state refresh, so could you do that from the map card itself

Anyways, just an idea if anyone wants to discuss further. Should anyone be interested in that as well, I can start a pull for Piotr to take into consideration.

Alternatives

No response

Context

No response