Dispaly hint if train is RE and stops are cancelled

This commit is contained in:
Julian Metzler 2022-11-30 20:54:59 +01:00
parent 21044e1407
commit 1be0fdef0c
1 changed files with 3 additions and 2 deletions

5
run.py
View File

@ -73,8 +73,9 @@ def update_display(display, dbi):
train_type = parts[0] = parts[1].rstrip("0123456789")
parts[1] = parts[1][len(parts[0]):]
if train_type == "RE":
display.info_2.set(NO_STOP_EVERYWHERE_TEXT)
if train_type == "RE" and any([stop.get('isCancelled') for stop in train['route']]):
# If we have an RE train and any stop on the way is cancelled
display.info_1.set("RE hält nicht überall")
is_arrival = any(filter(lambda arrival_station_name: filter_route(train['route'])[-1]['name'].startswith(arrival_station_name), ARRIVAL_STATIONS))