Show random train position indicator for S-Bahn
This commit is contained in:
parent
b8b0ae0cd1
commit
e5c0b01046
10
run.py
10
run.py
|
@ -6,6 +6,7 @@ from util import timeout, TimeoutError
|
|||
|
||||
import hashlib
|
||||
import json
|
||||
import random
|
||||
import time
|
||||
import traceback
|
||||
|
||||
|
@ -97,7 +98,14 @@ def update_display(display, dbi):
|
|||
delay_text = UNSPECIFIC_DELAY_TEXT
|
||||
display.info_2.set(delay_text)
|
||||
|
||||
display.info_1.set(TRAIN_TYPE_MAP.get(train_type, ""))
|
||||
train_type_text = TRAIN_TYPE_MAP.get(train_type, "")
|
||||
if train_type_text:
|
||||
display.info_1.set(train_type_text)
|
||||
elif train_type == "S":
|
||||
# Random train length indicator for S-Bahn
|
||||
random.seed(train['train'])
|
||||
train_length_pos = random.randint(56, 65)
|
||||
display.info_1.set(MAP_INFO_1[train_length_pos])
|
||||
|
||||
route = route_from([VIA_MAP.get(stop['name'], stop['name']) for stop in train['route']], STATION_NAME)[:-1]
|
||||
via_combination = get_vias(route, VIA_WEIGHTS, VIA_1, VIA_2, check_dashes=False, debug=True)
|
||||
|
|
Loading…
Reference in New Issue