metbril / home-assistant-brandstofprijzen

Home Assistant component for fuel prices from United Consumers
GNU General Public License v3.0
6 stars 0 forks source link

Errors in home-assistant.log-file #24

Closed pluim003 closed 9 months ago

pluim003 commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

Noticing these errors:

` 2023-12-20 16:06:20.162 ERROR (MainThread) [homeassistant.components.sensor] brandstofprijzen: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 575, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/brandstofprijzen/sensor.py", line 129, in update self._state = self.rest.data[idx]


IndexError: list index out of range
`

**To Reproduce**
Steps to reproduce the behavior:
1. Fire up HA
2. Look in home-assistant.log and see the error
3. 
**Expected behavior**
A clear and concise description of what you expected to happen.
No error. :-)

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: Debian bookworm
 - Browser NA
 - Version NA

**Additional context**
Add any other context about the problem here.
It looks like it seems to work without error as I see updates of the 'brandstofprijzen'
metbril commented 9 months ago

Thanks for reporting. I think this is a duplicate of #21?

pluim003 commented 9 months ago

Ok. That's an old one, but I couldn't find anyting with respect to the errormessages. And indeed there are 7 entities with adviesprijs but on my dashboard I only show 2 as I'm interested in only 2. :-) And actually I won't fill the tank at places where they charge the adviesprijs, as usually you can fill it for 25 cents less. :-)

metbril commented 9 months ago

I haven't freed the time to have a proper look, but a fix shouldn't be too hard. The code currently loops 1 time to much. I'll see if I can find some time in the coming week. Anyway, as far as I can see, all available prices are transferred to HA.

metbril commented 9 months ago

Closed as duplicate of #21.

metbril commented 9 months ago

Fixed in release v0.4.0 😄