JaccoR / hass-entso-e

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

Frequent crashes, removes existing prices #114

Open mickut opened 1 year ago

mickut commented 1 year ago

Quite frequently the integration crashes with:

Unexpected error fetching ENTSO-e coordinator data: 'dict_items' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/entsoe/coordinator.py", line 124, in _async_update_data
    for hour, price in self.data["data"].items()[-24:]:
TypeError: 'dict_items' object is not subscriptable

This has a side-effect of clearing the existing price information for the day.

pandersin commented 1 year ago

I've also seen couple of these.

This error originated from a custom integration.

Logger: custom_components.entsoe.coordinator Source: custom_components/entsoe/coordinator.py:124 Integration: ENTSO-e Transparency Platform (documentation, issues) First occurred: April 24, 2023 at 23:54:07 (1 occurrences) Last logged: April 24, 2023 at 23:54:07

Unexpected error fetching ENTSO-e coordinator data: 'dict_items' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/entsoe/coordinator.py", line 124, in _async_update_data for hour, price in self.data["data"].items()[-24:]: TypeError: 'dict_items' object is not subscriptable