IATkachenko / HA-YandexWeather

Yandex weather intergration for Home Assistant
Apache License 2.0
197 stars 10 forks source link

Не работает обновление данных в v3.1.3 в HA до `2024.2` #102

Closed IATkachenko closed 4 months ago

IATkachenko commented 4 months ago
          Стоит 3.1.3 и все равно не работает автоапдайт

Originally posted by @shurakr in https://github.com/IATkachenko/HA-YandexWeather/issues/99#issuecomment-1974696333

IATkachenko commented 4 months ago

@shurakr, debug лог пришлите, пожалуйста.

YaroslavPolykov commented 4 months ago

@IATkachenko Та же самая проблема.

Версия HA docker 2023.12.3

Мои логи:

2024-03-04 04:18:30.238 DEBUG (MainThread) [custom_components.yandex_weather.weather] state for restore: <state weather.yandex_weather=cloudy; temperature=-4.0, apparent_temperature=-4.0, temperature_unit=°C, humidity=94, pressure=135.03, pressure_unit=mmHg, wind_bearing=225, wind_speed=2.9, wind_speed_unit=m/s, visibility_unit=km, precipitation_unit=mm, forecast=[{'datetime': '2024-03-04T09:19:46.396796', 'wind_bearing': 225, 'precipitation_probability': 0, 'condition': 'cloudy', 'is_daytime': True, 'temperature': 0.0, 'templow': -1.0, 'pressure': 755.31, 'wind_speed': 5.8, 'precipitation': 0.0}, {'datetime': '2024-03-04T15:19:46.396796', 'wind_bearing': 225, 'precipitation_probability': 0, 'condition': 'clear-night', 'is_daytime': False, 'temperature': -3.0, 'templow': -4.0, 'pressure': 753.06, 'wind_speed': 5.0, 'precipitation': 0.0}], feels_like=-9, wind_gust=8.2, yandex_condition=Пасмурно, forecast_icons=['bkn_d', 'skc_n'], attribution=Data provided by Yandex Weather, entity_picture=https://yastatic.net/weather/i/icons/funky/dark/ovc.svg, friendly_name=Yandex Weather, supported_features=4 @ 2024-03-04T07:09:59.922981+03:00>
2024-03-04 04:18:30.239 DEBUG (MainThread) [custom_components.yandex_weather.weather] Time since last update: 0:08:30.316225 (2024-03-04 04:09:59.922981+00:00), update interval is 0:57:36
2024-03-04 04:18:30.239 DEBUG (MainThread) [custom_components.yandex_weather.updater] scheduling next refresh after offset=datetime.timedelta(seconds=2945, microseconds=683775)
2024-03-04 05:07:35.498 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback HomeAssistant.async_run_hass_job(<Job DataUpda...x7f6a970390>>>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 674, in async_run_hass_job
    return self.async_add_hass_job(hassjob, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 568, in async_add_hass_job
    task = self.loop.create_task(hassjob.target(*args), name=hassjob.name)
                                 ^^^^^^^^^^^^^^^^^^^^^
TypeError: DataUpdateCoordinator._handle_refresh_interval() missing 1 required positional argument: '_now'
YaroslavPolykov commented 4 months ago

@IATkachenko Та же самая проблема.

Версия HA docker 2023.12.3

Мои логи:

2024-03-04 04:18:30.238 DEBUG (MainThread) [custom_components.yandex_weather.weather] state for restore: <state weather.yandex_weather=cloudy; temperature=-4.0, apparent_temperature=-4.0, temperature_unit=°C, humidity=94, pressure=135.03, pressure_unit=mmHg, wind_bearing=225, wind_speed=2.9, wind_speed_unit=m/s, visibility_unit=km, precipitation_unit=mm, forecast=[{'datetime': '2024-03-04T09:19:46.396796', 'wind_bearing': 225, 'precipitation_probability': 0, 'condition': 'cloudy', 'is_daytime': True, 'temperature': 0.0, 'templow': -1.0, 'pressure': 755.31, 'wind_speed': 5.8, 'precipitation': 0.0}, {'datetime': '2024-03-04T15:19:46.396796', 'wind_bearing': 225, 'precipitation_probability': 0, 'condition': 'clear-night', 'is_daytime': False, 'temperature': -3.0, 'templow': -4.0, 'pressure': 753.06, 'wind_speed': 5.0, 'precipitation': 0.0}], feels_like=-9, wind_gust=8.2, yandex_condition=Пасмурно, forecast_icons=['bkn_d', 'skc_n'], attribution=Data provided by Yandex Weather, entity_picture=https://yastatic.net/weather/i/icons/funky/dark/ovc.svg, friendly_name=Yandex Weather, supported_features=4 @ 2024-03-04T07:09:59.922981+03:00>
2024-03-04 04:18:30.239 DEBUG (MainThread) [custom_components.yandex_weather.weather] Time since last update: 0:08:30.316225 (2024-03-04 04:09:59.922981+00:00), update interval is 0:57:36
2024-03-04 04:18:30.239 DEBUG (MainThread) [custom_components.yandex_weather.updater] scheduling next refresh after offset=datetime.timedelta(seconds=2945, microseconds=683775)
2024-03-04 05:07:35.498 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback HomeAssistant.async_run_hass_job(<Job DataUpda...x7f6a970390>>>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 674, in async_run_hass_job
    return self.async_add_hass_job(hassjob, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 568, in async_add_hass_job
    task = self.loop.create_task(hassjob.target(*args), name=hassjob.name)
                                 ^^^^^^^^^^^^^^^^^^^^^
TypeError: DataUpdateCoordinator._handle_refresh_interval() missing 1 required positional argument: '_now'

Протестировал версии 3.1.1 и 3.1.2. Проблем не наблюдаю, ошибки нету

IATkachenko commented 4 months ago

Ухх, спасибо за логи!

HA в 2024.2 перешел на новый механизм планирования следующего запуска задачи -- https://github.com/home-assistant/core/commit/8d3f693907fa24a54544e3fd7e017c9ec5c2a652 Поскольку в интеграции используется умное планирование первого обновления нам тоже пришлось перейти на новый механизм.

Поэтому сейчас варианта два:

Документацию и HACS сейчас поправлю.