Comments (2)
Same here, sometimes just flooding the log:
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
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:
"fairings": {
"reused": null,
"recovery_attempt": null,
"recovered": null,
"ships": []
},
"links": {
"patch": {
"small": null,
"large": null
},
"reddit": {
"campaign": null,
"launch": null,
"media": null,
"recovery": null
},
"flickr": {
"small": [],
"original": []
},
"presskit": null,
"webcast": null,
"youtube_id": null,
"article": null,
"wikipedia": null
},
"static_fire_date_utc": null,
"static_fire_date_unix": null,
"net": false,
"window": null,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": null,
"failures": [],
"details": null,
"crew": [],
"ships": [],
"capsules": [],
"payloads": [],
"launchpad": "5e9e4501f509094ba4566f84",
"flight_number": 165,
"name": "Transporter-5",
"date_utc": "2022-05-25T18:27:00.000Z",
"date_unix": 1653503220,
"date_local": "2022-05-25T14:27:00-04:00",
"date_precision": "hour",
"upcoming": true,
"cores": [
{
"core": "5f57c53d0622a6330279009f",
"flight": 8,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": null,
"landing_success": null,
"landing_type": null,
"landpad": null
}
],
"auto_update": true,
"tbd": false,
"launch_library_id": "949421ac-3802-499b-b383-d8274de7e147",
"id": "6243ae24af52800c6e919258"
}
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.
from haspacex.
Looks like it is happening again.
2022-06-20 14:50:50 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
from haspacex.
Related Issues (20)
- The "Next Launch Rocket" is not currently available. HOT 2
- Starman speed correct? HOT 5
- Please add version to manifest.json
- Connection_Class Warning in 2021.06.1 HA Version
- Feature Suggestion - SpaceX Updates HOT 2
- The connection class has been deprecated and will be removed in a future release of Home Assistant. HOT 1
- Repeating Error in Log File HOT 3
- Next Launch entities are now in the past. HOT 1
- Entities implementing deprecated attributes HOT 2
- Integration Broken HOT 2
- Issues with 2022.5.x HOT 2
- Next launch data wrong HOT 1
- Next Launch not updating HOT 2
- question? Are the Time entities converted to my local timezone or are they the time zone of the launch site? HOT 1
- Index Out of Range HOT 1
- Error fetching SpaceX data HOT 6
- SpaceX Integration not updated HOT 2
- Error fetching new data HOT 1
- Keeps popping up on hacs as new integration HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haspacex.