forked from kunsi/dotfiles
i3pystatus: try to use scheduledArrivalTime if actual arrival time does not exist
This commit is contained in:
parent
e486f477bb
commit
2957373488
1 changed files with 3 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue