i3pystatus: try to use scheduledArrivalTime if actual arrival time does not exist

This commit is contained in:
Franzi 2022-07-03 14:08:12 +02:00
parent e486f477bb
commit 2957373488
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -73,6 +73,9 @@ try:
if stop['timetable'].get('actualArrivalTime', 0):
arrival = datetime.fromtimestamp(stop['timetable']['actualArrivalTime']/1000)
arrival_in = arrival - now
elif stop['timetable'].get('scheduledArrivalTime', 0):
arrival = datetime.fromtimestamp(stop['timetable']['scheduledArrivalTime']/1000)
arrival_in = arrival - now
else:
arrival = datetime.now()
arrival_in = timedelta()