lozzd / octopus-energy-rates-card

This lovelace card for Home Assistant displays the Octopus Energy rate prices per each 30 minute slot
MIT License
60 stars 22 forks source link

Add card refresh interval to reduce CPU usage #71

Closed alinbalutoiu closed 3 months ago

alinbalutoiu commented 4 months ago

This PR adds an option for the card to refresh regularly skipping intensive CPU operations and improves the performance.

By default it will refresh once a minute, but it is configurable. The function gets called frequent enough (a few times a second in the tests), so this helps with the CPU usage.

On my macbook it reduced the CPU usage from around 5% to less than 1% according to the task manager (tested on a new dashboard containing only the Agile card).

Fixes: #59

alinbalutoiu commented 3 months ago

@lozzd any chance you can review this PR?

I've had it running on my local instance without any problems since then, it does help with the CPU usage reduction.

lozzd commented 3 months ago

Very nice! Thank you. Merged and release as v0.7.0, live now