Closed prestonsmartuk closed 3 months ago
This got me a bit more curious about how it works, and it seems that Home Assistant will call the update method quite often:
Home Assistant will set the hass property when the state of Home Assistant changes (frequent). Whenever the state changes, the component will have to update itself to represent the latest state.
In my case, that seems to be a few times per second. Obviously this card is pretty static and doesn't change much. It could use some optimisations to skip doing any work if nothing relevant has changed in the state.
Huh, nice digging. I had no clue where to start here but did some profiling (aka clicking around) in the Chrome dev tools and 90% of the CPU time was spent in the calls to convert the time to the user's locale. But that's only going to be a big deal if it's being called a few times a second.. that's definitely unnecessary!
@prestonsmartuk I would be curious if you can test with https://github.com/lozzd/octopus-energy-rates-card/pull/71 Wondering if that helps with making your tablet less laggy.
This is now live in HACS as version 0.7.0
Love this card. However on my Lenovo Tab K10 wall panel tablet using Fully Kiosk, this card (only this card) causes the tablet to really lag when in use. As soon as I remove this card from the UI, the tablet goes back to normal operation.
This might be a silly request, but as I've narrowed it down to this card being he culprit - would be great to see to see if this card could use less resources?