making it somehow worse
This commit is contained in:
parent
32a03f1f2a
commit
327de4b7e1
|
|
@ -13,7 +13,11 @@ timezone = pytz.timezone('Europe/Berlin')
|
||||||
statusData = None #initialize variables...
|
statusData = None #initialize variables...
|
||||||
tripData = None
|
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.
|
# Request the raw data from ICE-Portal and raise an exception, when it is not avialable.
|
||||||
def get_api_db():
|
def get_api_db():
|
||||||
|
|
@ -106,6 +110,9 @@ def get_next_tl():
|
||||||
arrivalTime = datetime.fromtimestamp(uActualTime, tz=timezone).strftime('%H:%M')
|
arrivalTime = datetime.fromtimestamp(uActualTime, tz=timezone).strftime('%H:%M')
|
||||||
tripinfo = nextStationName+" "+arrivalTime+" ("+arrivalDelay+")"
|
tripinfo = nextStationName+" "+arrivalTime+" ("+arrivalDelay+")"
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
nextStationName=tripDataTl['toStation']['name']
|
||||||
|
tripinfo=nextStationName
|
||||||
except:
|
except:
|
||||||
nextStationName=tripDataTl['toStation']['name']
|
nextStationName=tripDataTl['toStation']['name']
|
||||||
tripinfo=nextStationName
|
tripinfo=nextStationName
|
||||||
|
|
@ -145,7 +152,7 @@ def main():
|
||||||
get_api_tl()
|
get_api_tl()
|
||||||
print(get_trainInfo_tl()+" | NEXT: "+get_next_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()
|
get_api_tl()
|
||||||
print(get_trainInfo_tl()+" | NEXT: "+get_next_tl())
|
print(get_trainInfo_tl()+" | NEXT: "+get_next_tl())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue