Change train_type to operator for operator logic

This commit is contained in:
Julian Metzler 2022-11-30 21:56:01 +01:00
parent b1a16b603b
commit d476f2ccd9
1 changed files with 3 additions and 2 deletions

5
run.py
View File

@ -65,6 +65,7 @@ def update_display(display, dbi):
parts = train['train'].split()
train_type = parts[0]
operator = train_type
if train_type == "Bus":
display.info_2.set(BUS_REPLACEMENT_TEXT)
@ -100,11 +101,11 @@ def update_display(display, dbi):
if is_arrival:
display.info_2.set(DO_NOT_BOARD_TEXT)
if train_type == "BRB":
if operator == "BRB":
# Special case for BRB because it's on info_2
display.info_2.set("BRB Bayerische Regiobahn")
else:
train_type_text = TRAIN_TYPE_MAP.get(train_type, "")
train_type_text = TRAIN_TYPE_MAP.get(operator, "")
display.info_1.set(train_type_text)
if train_type == "RE" and any([stop.get('isCancelled') for stop in train['route']]):