custom-components / sensor.ruter

A sensor platform that gives you information about next departures.
MIT License
2 stars 2 forks source link

IndexError: list index out of range #7

Closed ronnyandre closed 5 years ago

ronnyandre commented 5 years ago

Version of the custom_component Latest

Describe the bug Component will not load realtime data from Ruter. Followed all steps from the readme.

Config:

  - platform: ruter
    stopid: 3012590
    destination: 'Jernbanetorget [T-bane] (Oslo)'

log

Thu Jan 10 2019 07:57:22 GMT+0100 (sentraleuropeisk normaltid)

Error while setting up platform ruter
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/ruter.py", line 53, in setup_platform
    add_devices([RuterSensor(stopid, destination, numer_of_departures)])
  File "/home/homeassistant/.homeassistant/custom_components/sensor/ruter.py", line 66, in __init__
    self.update()
  File "/home/homeassistant/.homeassistant/custom_components/sensor/ruter.py", line 73, in update
    self._line = result[self._index]['line']
IndexError: list index out of range
ludeeus commented 5 years ago

Hi @ronnyandre This platform is now a part of Home Assistant, so I will archive this repo now. https://www.home-assistant.io/components/sensor.ruter/

The reis API that this platform uses are shutting down soon, so you should consider using this instead: https://www.home-assistant.io/components/sensor.entur_public_transport/