From 239d0031924974f4cf38c32219999ad5d1af3f26 Mon Sep 17 00:00:00 2001 From: vonbirne Date: Sun, 5 Dec 2021 14:31:53 +0000 Subject: [PATCH] fix some bugs (#1) * change base url of api requests because the cert for portal.imice.de expired some weeks ago * cast arguments of format_time() to int because it threw a type error ** there might be nicer solutions Co-authored-by: Von Birne <> Reviewed-on: https://git.franzi.business/kunsi/dotfiles/pulls/1 Co-authored-by: vonbirne Co-committed-by: vonbirne --- .config/i3pystatus/ice-status.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/i3pystatus/ice-status.py b/.config/i3pystatus/ice-status.py index 0102911..8e77810 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() @@ -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: