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

Docked state polling and redrawing entire map every 3 seconds on fresh page load #149

Open codicusmaximus opened 10 months ago

codicusmaximus commented 10 months ago

https://github.com/Hypfer/lovelace-valetudo-map-card/blob/3ac4e80200b7afb3edee010b0ca77acab0189dac/src/valetudo-map-card.js#L25C38-L25C38

Since lastRobotState is initialized to "docked" but the pollInterval is initialized to 3 seconds ( POLL_INTERVAL_STATE_MAP["cleaning"] instead of POLL_INTERVAL_STATE_MAP["docked"] ) when the page is loaded when the vacuum is docked we have a 3 second hammering poll that is also killing the performance of my wall tablets when no cleaning is being performed. This should be POLL_INTERVAL_STATE_MAP["docked"];