diff --git a/app.py b/app.py index d9a6a97..7f1ae92 100644 --- a/app.py +++ b/app.py @@ -88,6 +88,12 @@ def recipe(): def handle_new_client(): updateState() +@socketio.on('eval scheme') +def eval_scheme(code): + output = phasectrl.safe_eval(code, statemachine.env) + phasectrl.safe_eval(f'(notify "{output}")', statemachine.env) + socketio.emit('eval output', output) + @socketio.on('get sensors history') def send_sensors_history(elements=1000): socketio.emit('sensor history', sensors.get_history(elements))