PiotrMachowski / Home-Assistant-custom-components-Tauron-AMIplus

This sensor uses unofficial API to get energy usage and generation data from https://elicznik.tauron-dystrybucja.pl.
MIT License
131 stars 34 forks source link

Integracja nie działa w HA 2023.3 #114

Closed pswid closed 1 year ago

pswid commented 1 year ago

Po aktualizacji HA do wersji 2023.3 (aktualnie beta 2023.3.0b4) integracja (v.2.4.6) nie uruchamia się. W logu pojawia się poniższy wpis. Być może błąd ma to związek z obsługą Pythona 3.11 która pojawiała się w HA 2023.3? Byłoby świetnie gdyby udało się "opanować problem" zanim oficjalna wersja HA 2023.3 zostanie wydana.

Logger: custom_components.tauron_amiplus.coordinator Source: custom_components/tauron_amiplus/statistics.py:184 Integration: Tauron AMIplus (documentation, issues) First occurred: 09:31:24 (2 occurrences) Last logged: 09:31:44

Unexpected error fetching tauron_amiplus data: '<=' not supported between instances of 'datetime.datetime' and 'float'

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/tauron_amiplus/coordinator.py", line 31, in _async_update_data
    await self.generate_statistics(data)
  File "/config/custom_components/tauron_amiplus/coordinator.py", line 37, in generate_statistics
    await statistics_updater.update_all(data)
  File "/config/custom_components/tauron_amiplus/statistics.py", line 65, in update_all
    await self.update_stats(s, v["name"], v["sum"], v["last_stats_time"], v["zone"], raw_data[v["data_source"]])
  File "/config/custom_components/tauron_amiplus/statistics.py", line 184, in update_stats
    if last_stats_time is not None and start <= last_stats_time:
TypeError: '<=' not supported between instances of 'datetime.datetime' and 'float'
PiotrMachowski commented 1 year ago

Wygląda to bardziej na zmiany w kodzie używanym do obsługi statystyk. Zobaczę, co da się zrobić

PiotrMachowski commented 1 year ago

Możesz zobaczyć, czy działa Ci wersja v2.4.7-beta.1?

pswid commented 1 year ago

Po aktualizacji do v2.4.7-beta.1 integracja znów działa. Dzięki za ekspresową poprawkę!

PiotrMachowski commented 1 year ago

Naprawione w v2.4.7