-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue with Payloads Detail Index out of Range #40
Comments
Same here, sometimes just flooding the log:
The value spacex_next_launch_payload (sensor.next_launch_payload) is unavailable. Looking at the API response (https://api.spacexdata.com/v4/launches/next) I see the payload very well undefined:
I guess this needs to be caught in code as SpaceX is not providing this data for each launch. I wonder if there is more values which might be missing and the code path should handle this accordingly. |
Looks like it is happening again.
|
Looks like it doesn't like something in the payloads index.
2022-05-18 14:19:11 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 137, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 270, in _async_refresh update_callback() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state if (state := self.state) is None: File "/config/custom_components/spacex/sensor.py", line 559, in state self._state = launch_data["payloads_detail"][0]["name"] IndexError: list index out of range
--
Adam
The text was updated successfully, but these errors were encountered: