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'] = ""
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:
status['time_since_hugvey_spoke'] = '-'
@ -215,10 +216,10 @@ class CentralCommand(object):
diff = datetime.timedelta(seconds=int(hv.story.timer.getElapsed('last_speech')))
status['time_since_visitor_spoke'] = str(diff)
diffs = diff.total_seconds()
if diffs > 1700:
if diffs > audienceCriticalDiff:
# evLogger.warning("Very long time since audience spoke")
status['time_since_visitor_spoke_state'] = 'critical'
elif diffs > 900:
elif diffs > audienceCriticalDiff/2:
status['time_since_visitor_spoke_state'] = 'warning'
# else:
# #clear warning

View File

@ -28,7 +28,7 @@ web_dir = os.path.join(os.path.split(__file__)[0], '..', 'www')
def getWebSocketHandler(central_command):
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()
selections = {}

View File

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