Changes to timer

This commit is contained in:
Ruben van de Ven 2020-02-15 16:14:25 +03:00
parent ac11645dd0
commit ad5e67f89a
3 changed files with 5 additions and 4 deletions

View file

@ -191,6 +191,7 @@ class CentralCommand(object):
status['time_since_visitor_spoke_state'] = "" status['time_since_visitor_spoke_state'] = ""
hugveyCriticalDiff = self.config['story']['hugvey_critical_silence'] if 'hugvey_critical_silence' in self.config['story'] else 90 hugveyCriticalDiff = self.config['story']['hugvey_critical_silence'] if 'hugvey_critical_silence' in self.config['story'] else 90
audienceCriticalDiff = self.config['story']['audience_critical_silence'] if 'audience_critical_silence' in self.config['story'] else 15*60
if not hv.story: if not hv.story:
status['time_since_hugvey_spoke'] = '-' status['time_since_hugvey_spoke'] = '-'
@ -215,10 +216,10 @@ class CentralCommand(object):
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)
diffs = diff.total_seconds() diffs = diff.total_seconds()
if diffs > 1700: if diffs > audienceCriticalDiff:
# evLogger.warning("Very long time since audience spoke") # evLogger.warning("Very long time since audience spoke")
status['time_since_visitor_spoke_state'] = 'critical' status['time_since_visitor_spoke_state'] = 'critical'
elif diffs > 900: elif diffs > audienceCriticalDiff/2:
status['time_since_visitor_spoke_state'] = 'warning' status['time_since_visitor_spoke_state'] = 'warning'
# else: # else:
# #clear warning # #clear warning

View file

@ -28,7 +28,7 @@ web_dir = os.path.join(os.path.split(__file__)[0], '..', 'www')
def getWebSocketHandler(central_command): def getWebSocketHandler(central_command):
class WebSocketHandler(tornado.websocket.WebSocketHandler): class WebSocketHandler(tornado.websocket.WebSocketHandler):
CORS_ORIGINS = ['localhost', 'hugveycmd.local', 'r3.local'] CORS_ORIGINS = ['localhost', 'hugveycmd.local', 'r3.local','192.168.1.155']
connections = set() connections = set()
selections = {} selections = {}

View file

@ -56,7 +56,7 @@ light:
fade_duration_id: 37 fade_duration_id: 37
story: story:
loop: true loop: true
hugvey_critical_silence: 90 hugvey_critical_silence: 210
telegram: telegram:
token: null token: null
chat_ids: [] chat_ids: []