mirror of https://github.com/home-assistant/core
Revert "Fix NMBS IndexError" (#90346)
This commit is contained in:
parent
94a52d5cca
commit
56293ad876
|
@ -162,11 +162,7 @@ class NMBSLiveBoard(SensorEntity):
|
||||||
"""Set the state equal to the next departure."""
|
"""Set the state equal to the next departure."""
|
||||||
liveboard = self._api_client.get_liveboard(self._station)
|
liveboard = self._api_client.get_liveboard(self._station)
|
||||||
|
|
||||||
if (
|
if liveboard is None or not liveboard.get("departures"):
|
||||||
liveboard is None
|
|
||||||
or not liveboard.get("departures")
|
|
||||||
or liveboard.get("number") == "0"
|
|
||||||
):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
next_departure = liveboard["departures"]["departure"][0]
|
next_departure = liveboard["departures"]["departure"][0]
|
||||||
|
|
Loading…
Reference in New Issue