Open rnovacek opened 11 months ago
I have Europe/Prague in homeassistant.yaml but have same error:
KeyError: datetime.datetime(2023, 9, 30, 22, 0, tzinfo=datetime.timezone.utc)
2023-10-01 10:29:20.481 DEBUG (MainThread) [custom_components.cz_energy_spot_prices.coordinator] Finished fetching Czech Energy Spot Prices data in 0.164 seconds (success: False)
2023-10-01 10:30:40.788 DEBUG (MainThread) [custom_components.cz_energy_spot_prices] async_setup_entry None data: [{'currency': 'CZK', 'unit_of_measurement': 'kWh'}]; options: [{}]
2023-10-01 10:30:40.788 DEBUG (MainThread) [custom_components.cz_energy_spot_prices.coordinator] SpotRateCoordinator.__init__
2023-10-01 10:30:40.789 DEBUG (MainThread) [custom_components.cz_energy_spot_prices.coordinator] SpotRateCoordinator._async_update_data
2023-10-01 10:30:42.037 ERROR (MainThread) [custom_components.cz_energy_spot_prices.coordinator] Unexpected error fetching Czech Energy Spot Prices data: datetime.datetime(2023, 9, 30, 22, 0, tzinfo=datetime.timezone.utc)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/cz_energy_spot_prices/coordinator.py", line 213, in _async_update_data
gas=DailySpotRateData(gas_rates, zoneinfo=zoneinfo),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/cz_energy_spot_prices/coordinator.py", line 144, in __init__
self._today = rates[midnight_today]
~~~~~^^^^^^^^^^^^^^^^
Tak beru zpet, ted jsem si vsiml, ze mam rozdilne velikosti souboru, takze zrejme starsi verzi projektu. Po prepsani je uz vse ok.
There are some problems if the current timezone is different than
Europe/Prague
.For example with London timezone, this error occurs:
Workaround is to set the timezone to
Europe/Prague
.