mawinkler / astroweather

Asynchronous Astro Weather Forecast for Home Assistant
GNU General Public License v3.0
69 stars 9 forks source link

Unknown forecast #10

Closed tomlut closed 2 years ago

tomlut commented 2 years ago

Running v0.20.7 in Home AssistantOS I am now getting this error and no forecasts (was working):

Logger: homeassistant.components.weather
Source: custom_components/astroweather/weather.py:200
Integration: Weather (documentation, issues)
First occurred: 23:26:57 (2 occurrences)
Last logged: 23:26:57

Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 801, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 553, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 593, in _async_write_ha_state
    extra_state_attributes = self.extra_state_attributes
  File "/config/custom_components/astroweather/weather.py", line 327, in extra_state_attributes
    ATTR_WEATHER_DEEPSKY_TODAY_PLAIN: self.deepsky_forecast_today_plain,
  File "/config/custom_components/astroweather/weather.py", line 200, in deepsky_forecast_today_plain
    return self._current.deepsky_forecast_today_plain
  File "/usr/local/lib/python3.9/site-packages/pyastroweatherio/dataclasses.py", line 285, in deepsky_forecast_today_plain
    nightly_conditions = self._deepsky_forecast[0]
IndexError: list index out of range
mawinkler commented 2 years ago

Thank you for reporting this. A quick check revealed, that 7timer does not update the data since yesterday noon, so there is no forecast for tomorrow night at the moment. I will release a more resilient version of the components likely this evening and simultaneously hope that 7timer will fix its problems as well.

mawinkler commented 2 years ago

Should be fixed with v0.20.8. Fingers crossed for 7timer.