From 7d541c9f7eb5c0107e388fa7e249c5762643c1b0 Mon Sep 17 00:00:00 2001 From: Von Birne <> Date: Mon, 29 Nov 2021 23:40:17 +0100 Subject: [PATCH 1/3] i3pystatus/ice-status.py change api url cert for portal.imice.de expired 2 weeks ago --- .config/i3pystatus/ice-status.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index 0102911..4a1f3b1 100755 --- a/.config/i3pystatus/ice-status.py +++ b/.config/i3pystatus/ice-status.py @@ -33,11 +33,11 @@ try: now = datetime.now() - trip_info_req = get('https://portal.imice.de/api1/rs/tripInfo/trip') + trip_info_req = get('https://iceportal.de/api1/rs/tripInfo/trip') trip_info_req.raise_for_status() trip_info = trip_info_req.json()['trip'] - ice_status_req = get('https://portal.imice.de/api1/rs/status') + ice_status_req = get('https://iceportal.de/api1/rs/status') ice_status_req.raise_for_status() ice_status = ice_status_req.json() -- 2.39.5 From a4d873becd78cab8f47bcab6d98718f2c7400486 Mon Sep 17 00:00:00 2001 From: Von Birne <> Date: Mon, 29 Nov 2021 23:42:39 +0100 Subject: [PATCH 2/3] i3pystatus/ice-status.py cast time to int --- .config/i3pystatus/ice-status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index 4a1f3b1..8e77810 100755 --- a/.config/i3pystatus/ice-status.py +++ b/.config/i3pystatus/ice-status.py @@ -67,7 +67,7 @@ try: ice_status['speed'], next_stop, ice_status['connectivity']['currentState'], - format_time(ice_status['connectivity']['remainingTimeSeconds']), + format_time(int(ice_status['connectivity']['remainingTimeSeconds'])), ice_status['connectivity']['nextState'], )) except Exception as e: -- 2.39.5 From 05636a6568e984a0aa01efa5b6402f5872b70fb0 Mon Sep 17 00:00:00 2001 From: Von Birne <> Date: Tue, 7 Dec 2021 20:31:15 +0100 Subject: [PATCH 3/3] fix the bug with format time for real ice_status['connectivity']['remainingTimeSeconds'] might be None --- .config/i3pystatus/ice-status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index 8e77810..f9c9fb6 100755 --- a/.config/i3pystatus/ice-status.py +++ b/.config/i3pystatus/ice-status.py @@ -8,6 +8,8 @@ from sys import exit # bundlewrap.utils.text.format_duration, but trimmed down def format_time(seconds): + if seconds is None: + return "?" components = [] if seconds >= 3600: hours = int(seconds / 3600) @@ -67,7 +69,7 @@ try: ice_status['speed'], next_stop, ice_status['connectivity']['currentState'], - format_time(int(ice_status['connectivity']['remainingTimeSeconds'])), + format_time(ice_status['connectivity']['remainingTimeSeconds']), ice_status['connectivity']['nextState'], )) except Exception as e: -- 2.39.5