From 2957373488c3f619050a0a3f253f4a61216bbc11 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 3 Jul 2022 14:08:12 +0200 Subject: [PATCH] i3pystatus: try to use scheduledArrivalTime if actual arrival time does not exist --- .config/i3pystatus/ice-status.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index 902a805..c34bf6d 100755 --- a/.config/i3pystatus/ice-status.py +++ b/.config/i3pystatus/ice-status.py @@ -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()