andreas-berg / hass-entsoe-dayahead

Integration for Home Assistant to fetch day ahead energy prices from European countries via ENTSO-e Transparency Platform
14 stars 1 forks source link

High CPU with 2023.12 #2

Closed basilfx closed 9 months ago

basilfx commented 9 months ago

I've added this integration, but since I installed it, I have high CPU usage.

Using py-spy, this is the top:

image

For some reason, it keeps invoking these three functions over and over. The integration works fine though.

Disabling the integration solves the issue, but requires a restart of HASS (it is probably not unloading properly).

Using Home Assistant 2023.12.2.

andreas-berg commented 9 months ago

Thanks for the issue report and py-spy-logs, sorry for the slow response. This should be fixed now in the main-branch. Let's keep this issue open a few days until I've verified that the Sensor updates correctly. I also removed some "RestoreSensor"-code since I wasn't hass-savvy enough to figure out how HomeAssistant stores/restores these values from db.

basilfx commented 9 months ago

Thank you, and no worries.

So far it looks good, and I don't see high CPU usage anymore.

andreas-berg commented 9 months ago

Seems to run quite fine now, so closing the issue