Only show S-Bahn position for S-Bahn

This commit is contained in:
Julian Metzler 2022-03-19 21:49:30 +01:00
parent 187e7ad16a
commit a3b17da81d
1 changed files with 3 additions and 1 deletions

4
run.py
View File

@ -97,11 +97,13 @@ def update_display(display, dbi):
elif delay > 60:
delay_text = UNSPECIFIC_DELAY_TEXT
display.info_2.set(delay_text)
else:
elif train_type == "S":
# Random train length indicator for S-Bahn
random.seed(train['train'])
train_length_pos = random.randint(36, 45)
display.info_2.set(MAP_INFO_2[train_length_pos])
else:
display.info_2.set("")
train_type_text = TRAIN_TYPE_MAP.get(train_type, "")
display.info_1.set(train_type_text)