From a4f5327547fafeb6280b0018459b375cbc8ad955 Mon Sep 17 00:00:00 2001 From: Arjan <44190435+vingerha@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:28:42 +0100 Subject: [PATCH] Next attemtp to fix rt on local stops --- custom_components/gtfs2/gtfs_rt_helper.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/custom_components/gtfs2/gtfs_rt_helper.py b/custom_components/gtfs2/gtfs_rt_helper.py index 5abd419..f14f1c0 100644 --- a/custom_components/gtfs2/gtfs_rt_helper.py +++ b/custom_components/gtfs2/gtfs_rt_helper.py @@ -350,13 +350,23 @@ def get_rt_route_trip_statuses(self): if entity.trip_update.trip.direction_id is not None: direction_id = str(entity.trip_update.trip.direction_id) else: - direction_id = DEFAULT_DIRECTION + direction_id = [DEFAULT_DIRECTION] + + if self._rt_group == "trip": + direction_id = self._direction trip_id = entity.trip_update.trip.trip_id - + if ((self._rt_group == "route" and route_id == self._route_id and direction_id == self._direction) or (self._rt_group == "trip" and trip_id == self._trip_id )): + + + _LOGGER.debug("Entity found params, group: %s, route_id: %s, direction_id: %s, trip_id: %s", self._rt_group, route_id, direction_id, self._trip_id) + _LOGGER.debug("Entity found: %s", entity) + + + if route_id not in departure_times: departure_times[route_id] = {}