i3pystatus/ice-status: fix delay display, add track info
This commit is contained in:
parent
8f4229b1e2
commit
e920bf8281
1 changed files with 8 additions and 2 deletions
|
@ -38,10 +38,16 @@ try:
|
||||||
next_stop_id = trip_info['stopInfo']['actualNext']
|
next_stop_id = trip_info['stopInfo']['actualNext']
|
||||||
for stop in trip_info['stops']:
|
for stop in trip_info['stops']:
|
||||||
if stop['station']['evaNr'] == next_stop_id:
|
if stop['station']['evaNr'] == next_stop_id:
|
||||||
next_stop = '{} {}{}'.format(
|
if stop['timetable']['departureDelay']:
|
||||||
|
delay = ' ({})'.format(stop['timetable']['departureDelay'])
|
||||||
|
else:
|
||||||
|
delay = ''
|
||||||
|
|
||||||
|
next_stop = '{} [{}] {}{}'.format(
|
||||||
stop['station']['name'],
|
stop['station']['name'],
|
||||||
|
stop['track']['actual'],
|
||||||
datetime.fromtimestamp(stop['timetable']['actualArrivalTime']/1000).strftime('%H:%M'),
|
datetime.fromtimestamp(stop['timetable']['actualArrivalTime']/1000).strftime('%H:%M'),
|
||||||
stop['timetable']['departureDelay'] if stop['timetable']['departureDelay'] else '',
|
delay
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue