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 #309

Open
functionpointer opened this issue Sep 2, 2024 · 0 comments
Open

List index out of range #309

functionpointer opened this issue Sep 2, 2024 · 0 comments

Comments

@functionpointer
Copy link
Contributor

I was recompiling OpenSprinkler and it reset itself to default settings. This caused all entities to become "unavailable". This is already strange as i expected a reauthentication error.
In any case, i reactivated my usual "ignore password" setting and the entities stayed unavailable, with the following error repeating:

Sep 02 10:08:52 myhostname hass[413]: 2024-09-02 10:08:52.887 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Sep 02 10:08:52 myhostname hass[413]: Traceback (most recent call last):
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
Sep 02 10:08:52 myhostname hass[413]:     await self._async_refresh(log_failures=True, scheduled=True)
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
Sep 02 10:08:52 myhostname hass[413]:     self.async_update_listeners()
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
Sep 02 10:08:52 myhostname hass[413]:     update_callback()
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
Sep 02 10:08:52 myhostname hass[413]:     self._async_write_ha_state()
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
Sep 02 10:08:52 myhostname hass[413]:     self.__async_calculate_state()
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/entity.py", line 1096, in __async_calculate_state
Sep 02 10:08:52 myhostname hass[413]:     name := (entry and entry.name) or self._friendly_name_internal()
Sep 02 10:08:52 myhostname hass[413]:                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/homeassistant/helpers/entity.py", line 1028, in _friendly_name_internal
Sep 02 10:08:52 myhostname hass[413]:     name = self.name
Sep 02 10:08:52 myhostname hass[413]:            ^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/config/custom_components/opensprinkler/binary_sensor.py", line 116, in name
Sep 02 10:08:52 myhostname hass[413]:     return self._program.name + " Program Running"
Sep 02 10:08:52 myhostname hass[413]:            ^^^^^^^^^^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/venv/lib/python3.12/site-packages/pyopensprinkler/program.py", line 396, in name
Sep 02 10:08:52 myhostname hass[413]:     return self._get_variable(5)
Sep 02 10:08:52 myhostname hass[413]:            ^^^^^^^^^^^^^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/venv/lib/python3.12/site-packages/pyopensprinkler/program.py", line 35, in _get_variable
Sep 02 10:08:52 myhostname hass[413]:     return self._get_program_data()[variable_index]
Sep 02 10:08:52 myhostname hass[413]:            ^^^^^^^^^^^^^^^^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]:   File "/opt/myhass-home/my-hass/venv/lib/python3.12/site-packages/pyopensprinkler/program.py", line 31, in _get_program_data
Sep 02 10:08:52 myhostname hass[413]:     return self._controller._state["programs"]["pd"][self._index]
Sep 02 10:08:52 myhostname hass[413]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
Sep 02 10:08:52 myhostname hass[413]: IndexError: list index out of range

After reloading the integration everything works.

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

1 participant