Compare commits

...

3 commits

Author SHA1 Message Date
Von Birne
05636a6568 fix the bug with format time for real
ice_status['connectivity']['remainingTimeSeconds'] might be None
2021-12-07 20:31:15 +01:00
Von Birne
a4d873becd i3pystatus/ice-status.py cast time to int 2021-11-29 23:42:39 +01:00
Von Birne
7d541c9f7e i3pystatus/ice-status.py change api url
cert for portal.imice.de expired 2 weeks ago
2021-11-29 23:40:17 +01:00

View file

@ -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)
@ -33,11 +35,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()