mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix gtfs typing (#120451)
This commit is contained in:
parent
75c7ae7c69
commit
9dc26652ee
@ -270,7 +270,7 @@ def get_next_departure(
|
|||||||
schedule: Any,
|
schedule: Any,
|
||||||
start_station_id: Any,
|
start_station_id: Any,
|
||||||
end_station_id: Any,
|
end_station_id: Any,
|
||||||
offset: cv.time_period,
|
offset: datetime.timedelta,
|
||||||
include_tomorrow: bool = False,
|
include_tomorrow: bool = False,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
"""Get the next departure for the given schedule."""
|
"""Get the next departure for the given schedule."""
|
||||||
@ -405,7 +405,7 @@ def get_next_departure(
|
|||||||
|
|
||||||
item = {}
|
item = {}
|
||||||
for key in sorted(timetable.keys()):
|
for key in sorted(timetable.keys()):
|
||||||
if dt_util.parse_datetime(key) > now:
|
if (value := dt_util.parse_datetime(key)) is not None and value > now:
|
||||||
item = timetable[key]
|
item = timetable[key]
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Departure found for station %s @ %s -> %s", start_station_id, key, item
|
"Departure found for station %s @ %s -> %s", start_station_id, key, item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user