IATkachenko / HA-YandexWeather

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

В логах HA выдает ошибку ValueError: is_daytime mandatory attribute for forecast_twice_daily is missing #118

Closed EvgenyBash closed 2 months ago

EvgenyBash commented 2 months ago

The problem

Ошибка в логах HA:

2024-04-14 10:59:47.672 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140634439567808] Error handling message: Unknown error (unknown_error)  (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/weather/websocket_api.py", line 103, in ws_subscribe_forecast
    await entity.async_update_listeners({forecast_type})
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 1011, in async_update_listeners
    raise ValueError(
ValueError: is_daytime mandatory attribute for forecast_twice_daily is missing

What version of the integration has the issue?

v3.2.2

What version of Home Assistant Core has the issue?

core-2024.4.3

What type of installation are you running?

Home Assistant Supervised

Anything in the logs that might be useful for us?

No response

Additional information

No response

IATkachenko commented 2 months ago

Спасибо! Исправлено в v3.2.4

EvgenyBash commented 2 months ago

Странно, поставил версию 3.2.4, но в логах всё равно эта ошибка появляется.

IATkachenko commented 2 months ago

@EvgenyBash, у себя проблем не вижу. Можете добавить вот сюда https://github.com/IATkachenko/HA-YandexWeather/blob/main/custom_components/yandex_weather/weather.py#L274, перед return, строчку (должна начинаться на том же уровне что и return):

        _LOGGER.debug(f"async_forecast_twice_daily: {result=}")

и прислать лог с тем что async_forecast_twice_daily рассказывает до и после исправления прогноза?

EvgenyBash commented 2 months ago

@EvgenyBash, у себя проблем не вижу. Можете добавить вот сюда https://github.com/IATkachenko/HA-YandexWeather/blob/main/custom_components/yandex_weather/weather.py#L274, перед return, строчку (должна начинаться на том же уровне что и return):

        _LOGGER.debug(f"async_forecast_twice_daily: {result=}")

и прислать лог с тем что async_forecast_twice_daily рассказывает до и после исправления прогноза?

Вроде всё наладилось. Ошибок теперь нет. Возможно просто кэш не почистил.