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

IndexError: list index out of range #177

Open
Kanecaine opened this issue Dec 31, 2024 · 2 comments
Open

IndexError: list index out of range #177

Kanecaine opened this issue Dec 31, 2024 · 2 comments
Labels
done Done, waiting for confirmation

Comments

@Kanecaine
Copy link

Kanecaine commented Dec 31, 2024

Version of home_assistant

Version core-2024.12.5
Installationstyp Home Assistant OS
Entwicklung false
Supervisor true
Docker true
Benutzer root
Virtuelle Umgebung false
Python-Version 3.13.0
Betriebssystemfamilie Linux
Betriebssystem-Version 6.6.66-haos
CPU-Architektur x86_64

How are you running home_assistant

I am running HAOS on proxmox

Version of the custom_component

v2.1.26

Describe the bug

I recently had the following error in the logs. Otherwise, the integration works without any problems and weather data is retrieved correctly.

Debug log

Logger: custom_components.dwd_weather
Quelle: helpers/update_coordinator.py:379
Integration: Deutscher Wetterdienst (Dokumentation, Probleme)
Erstmals aufgetreten: 10:40:28 (1 Vorkommnisse)
Zuletzt protokolliert: 10:40:28

Unexpected error fetching DWD Weather Coordinator for 10471 data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 280, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dwd_weather/connector.py", line 129, in async_update
    if await self._hass.async_add_executor_job(self._update):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/dwd_weather/connector.py", line 138, in _update
    self.dwd_weather.update(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        force_hourly=self._config[CONF_HOURLY_UPDATE],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        with_uv=True,
        ^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 674, in update
    self.download_latest_kml(self.station_id, force_hourly)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 1027, in download_latest_kml
    self.parse_kml(kml)
    ~~~~~~~~~~~~~~^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 707, in parse_kml
    self.loaded_station_name = self.parse_station_name(tree)
                               ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 760, in parse_station_name
    return tree.xpath(
           ~~~~~~~~~~~
        "./kml:Document/kml:Placemark/kml:description", namespaces=self.namespaces
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    )[0].text
    ~^^^
IndexError: list index out of range

@FL550
Copy link
Owner

FL550 commented Jan 1, 2025

Thanks for reporting!

@FL550
Copy link
Owner

FL550 commented Jan 15, 2025

I'll fixed this in the underlaying library and will be included in a next release. Best regards!

@FL550 FL550 added the done Done, waiting for confirmation label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Done, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants