making it somehow worse

This commit is contained in:
chrissy 2026-01-03 18:55:01 +01:00
parent 32a03f1f2a
commit 327de4b7e1
1 changed files with 9 additions and 2 deletions

View File

@ -13,7 +13,11 @@ timezone = pytz.timezone('Europe/Berlin')
statusData = None #initialize variables...
tripData = None
tlApiToken="[YOUR API TOKEN]
# Your Travelynx-Api-token goes here
tlApiToken="[YOUR API TOKEN]"
# Known SSIDs for some regional train Wifis...
ssid_regio=["Wifi@DB","RRX Hotspot","Abellio Free WiFi","Arriva","DVB-Hotspot","ENNO_WiFi","FlixTrain Wi-Fi","MAVSTART-WiFi","ODEG Free WiFi","OEBB","RegioJet - zluty","Regiojet - zluty","Wifi@start","alex WiFi","trilex WiFi"]
# Request the raw data from ICE-Portal and raise an exception, when it is not avialable.
def get_api_db():
@ -106,6 +110,9 @@ def get_next_tl():
arrivalTime = datetime.fromtimestamp(uActualTime, tz=timezone).strftime('%H:%M')
tripinfo = nextStationName+" "+arrivalTime+" ("+arrivalDelay+")"
break
else:
nextStationName=tripDataTl['toStation']['name']
tripinfo=nextStationName
except:
nextStationName=tripDataTl['toStation']['name']
tripinfo=nextStationName
@ -145,7 +152,7 @@ def main():
get_api_tl()
print(get_trainInfo_tl()+" | NEXT: "+get_next_tl())
if get_ssid() == "WIFI@DB" or "RRX Hotspot":
if get_ssid() in ssid_regio:
get_api_tl()
print(get_trainInfo_tl()+" | NEXT: "+get_next_tl())