From 31d62a9710ab17e2406d686a73f98ec26c588a5c Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Thu, 14 Nov 2019 15:06:15 +0100 Subject: [PATCH] Fix error on diff --- hugvey/central_command.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hugvey/central_command.py b/hugvey/central_command.py index d9d0825..28e9eed 100644 --- a/hugvey/central_command.py +++ b/hugvey/central_command.py @@ -177,9 +177,10 @@ class CentralCommand(object): else: diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed() - hv.story.lastMsgFinishTime)) status['time_since_hugvey_spoke'] = str(diff) - if diff > 300: + diffs = diff.total_seconds() + if diffs > 300: status['time_since_hugvey_spoke_state'] = 'critical' - elif diff > 100: + elif diffs > 100: status['time_since_hugvey_spoke_state'] = 'warning' if not hv.story.timer.hasMark('last_speech'): @@ -187,10 +188,11 @@ class CentralCommand(object): else: diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed('last_speech'))) 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") status['time_since_visitor_spoke'] = 'critical' - elif diff > 100: + elif diffs > 100: status['time_since_visitor_spoke'] = 'warning' # else: # #clear warning