ice-status: fix int conversion

This commit is contained in:
Franzi 2021-12-10 15:53:20 +01:00
parent 88ed4d22f0
commit defa59dfe2
Signed by untrusted user: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -10,6 +10,7 @@ from sys import exit
def format_time(seconds): def format_time(seconds):
if seconds is None: if seconds is None:
return "?" return "?"
seconds = int(seconds)
components = [] components = []
if seconds >= 3600: if seconds >= 3600:
hours = int(seconds / 3600) hours = int(seconds / 3600)
@ -69,7 +70,7 @@ try:
ice_status['speed'], ice_status['speed'],
next_stop, next_stop,
ice_status['connectivity']['currentState'], ice_status['connectivity']['currentState'],
format_time(int(ice_status['connectivity']['remainingTimeSeconds'])), format_time(ice_status['connectivity']['remainingTimeSeconds']),
ice_status['connectivity']['nextState'], ice_status['connectivity']['nextState'],
)) ))
except Exception as e: except Exception as e: