Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"List index out of range" failure since 5am 17/04/2024 #55

Closed
smalinj opened this issue Apr 17, 2024 · 7 comments
Closed

"List index out of range" failure since 5am 17/04/2024 #55

smalinj opened this issue Apr 17, 2024 · 7 comments

Comments

@smalinj
Copy link

smalinj commented Apr 17, 2024

Hi,

I have an issue with astroweather integration.

Since 5am this morning I have an issue

Screenshot_20240417-135741

Reloading initilization doesn't work.

Only error is list index out of range.

@Erreur32
Copy link

Same for me from today only also.

@mawinkler
Copy link
Owner

There is a "shortage" on weather forecast data at 7timer currently, as far as I have seen. Sadly I missed handling this in one of the loops.

For a quick fix change the pyastroweatherio dependency in your manifest.json to

    "requirements": [
        "pyastroweatherio==0.43.1.dev4"
    ],

You will only get the forecast for this day currently, but it does not error out anymore.

@Daali
Copy link

Daali commented Apr 17, 2024

Thanks for the work mawinkler, these things happen. made the change and the error went away, the daily stuff on the card is working.

@Erreur32
Copy link

Thanks for the quick update ;)
For me i will waiting your next update, no issue !

Thanks for your good works.

@rlause
Copy link

rlause commented Apr 17, 2024

Get the same error. Although it seems to be a known problem just as additional information my corresponding log entry:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.astroweather
Quelle: helpers/update_coordinator.py:315
Integration: AstroWeather (Dokumentation, Probleme)
Erstmals aufgetreten: 15:24:12 (26 Vorkommnisse)
Zuletzt protokolliert: 15:49:11

Unexpected error fetching astroweather data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 102, in get_location_data
    return await self._get_location_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 216, in _get_location_data
    "deepsky_forecast": await self._get_deepsky_forecast(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 431, in _get_deepsky_forecast
    start_index = start_indexes[day]
                 ~~~~~~~~~~~~~^^^^^
IndexError: list index out of range

@mawinkler
Copy link
Owner

Get the same error. Although it seems to be a known problem just as additional information my corresponding log entry:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.astroweather
Quelle: helpers/update_coordinator.py:315
Integration: AstroWeather (Dokumentation, Probleme)
Erstmals aufgetreten: 15:24:12 (26 Vorkommnisse)
Zuletzt protokolliert: 15:49:11

Unexpected error fetching astroweather data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 102, in get_location_data
    return await self._get_location_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 216, in _get_location_data
    "deepsky_forecast": await self._get_deepsky_forecast(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 431, in _get_deepsky_forecast
    start_index = start_indexes[day]
                 ~~~~~~~~~~~~~^^^^^
IndexError: list index out of range

please see my comment from above.

There will be a new release with some (hopefully) nice new features for you all, as time permits.

@mawinkler
Copy link
Owner

Fixed with release 0.50.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants