Skip to content

Commit

Permalink
Fix for
Browse files Browse the repository at this point in the history
  • Loading branch information
megakid authored Aug 23, 2022
1 parent 2fc3ed6 commit 78940c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/realtime_trains_api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ async def _async_update(self):
"platform": departure["locationDetail"].get("platform", None),
"operator_name": departure["atocName"],
}
if departureCount <= self._journey_data_for_next_X_trains:
await self._add_journey_data(train, scheduledTs, estimatedTs)
if departureCount > self._journey_data_for_next_X_trains:
break;

await self._add_journey_data(train, scheduledTs, estimatedTs)
self._next_trains.append(train)

if nextDepartureEstimatedTs is None:
Expand Down

0 comments on commit 78940c4

Please sign in to comment.