Fix error on diff

This commit is contained in:
Ruben van de Ven 2019-11-14 15:06:15 +01:00
parent 70a146491f
commit 31d62a9710

View file

@ -177,9 +177,10 @@ class CentralCommand(object):
else: else:
diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed() - hv.story.lastMsgFinishTime)) diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed() - hv.story.lastMsgFinishTime))
status['time_since_hugvey_spoke'] = str(diff) status['time_since_hugvey_spoke'] = str(diff)
if diff > 300: diffs = diff.total_seconds()
if diffs > 300:
status['time_since_hugvey_spoke_state'] = 'critical' status['time_since_hugvey_spoke_state'] = 'critical'
elif diff > 100: elif diffs > 100:
status['time_since_hugvey_spoke_state'] = 'warning' status['time_since_hugvey_spoke_state'] = 'warning'
if not hv.story.timer.hasMark('last_speech'): if not hv.story.timer.hasMark('last_speech'):
@ -187,10 +188,11 @@ class CentralCommand(object):
else: else:
diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed('last_speech'))) diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed('last_speech')))
status['time_since_visitor_spoke'] = str(diff) status['time_since_visitor_spoke'] = str(diff)
if diff > 300: diffs = diff.total_seconds()
if diffs > 300:
# evLogger.warning("Very long time since audience spoke") # evLogger.warning("Very long time since audience spoke")
status['time_since_visitor_spoke'] = 'critical' status['time_since_visitor_spoke'] = 'critical'
elif diff > 100: elif diffs > 100:
status['time_since_visitor_spoke'] = 'warning' status['time_since_visitor_spoke'] = 'warning'
# else: # else:
# #clear warning # #clear warning