list index out of range error
See original GitHub issueDescribe the bug
2021-10-26 14:31:07 ERROR (MainThread) [custom_components.hildebrandglow_dcc.sensor] Key Error - plan (list index out of range): ({'status': 'OK', 'name': 'gas consumption', 're
sourceTypeId': '08ab415f-d851-423f-adf4-c2b1e0529e27', 'resourceId': 'b1f5af6e-3507-453c-ab8f-66ff9606b7de', 'data': [], 'classifier': 'gas.consumption'})
2021-10-26 14:31:08 ERROR (MainThread) [custom_components.hildebrandglow_dcc.sensor] Lookup Error - plan (list index out of range): ({'status': 'OK', 'name': 'gas consumption',
'resourceTypeId': '08ab415f-d851-423f-adf4-c2b1e0529e27', 'resourceId': 'b1f5af6e-3507-453c-ab8f-66ff9606b7de', 'data': [], 'classifier': 'gas.consumption'})
To Reproduce only added in my bright iOS details (im a british gas customer with a smart elec/gas/monitor all DCC with no glow hub)
Expected behaviour not sure?
Screenshots If applicable, add screenshots to help explain your problem.
Version LATEST - v0.5.0 and HA core-2021.10.6
Debug log Enable debug logging by following the instructions here TO FOLLOW
Additional context i think this error is because british gas have goofed up my gas tariff, so its showing in HA AND the bright iOS app as NO TRARIFF and its not calculating the cost either
Issue Analytics
- State:
- Created 2 years ago
- Comments:27 (5 by maintainers)
Top Results From Across the Web
List Index Out of Range – Python Error Message Solved
You'll get the Indexerror: list index out of range error when iterating through a list and trying to access an item that doesn't...
Read more >Python IndexError: List Index Out of Range Error Explained
We can break down the text a little bit. We can see here that the message tells us that the index is out...
Read more >Python IndexError: List Index Out of Range [Easy Fix] - Finxter
The error “list index out of range” arises if you access invalid indices in your Python list. For example, if you try to...
Read more >Indexerror: list Index Out of Range in Python - STechies
In the above case, the error occurs inline 5, as shown in output where print(list_fruits[i]) means that the value of “i” exceeds the...
Read more >Index Error: list index out of range (Python) - Stack Overflow
Generally it means that you are providing an index for which a list element does not exist. E.g, if your list was [1,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is what I’d expect.
UPDATED
“Unavailable” while it is in a boot up phase. It can be several minutes before it tries to collect data. (Or the sensor / code has been removed)
“Unknown” it has tried to get the data, but there is nothing there.
@townsmcp I’ve had a go at changing the error handling, so it only reports “no data” once. HOWEVER, as I have data, I am unable to test it!
Would you be able to replace your "custom_components/hildebrandglow_dcc/sensor.py with sensor.py and try it?
The expected behaviour is you will see the error reported only once.
@si458 rather than report a 0, it should report the sensor is unavailable.