app: add scheme eval socketio function
This commit is contained in:
parent
44c0272434
commit
44e62713c2
6
app.py
6
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))
|
||||
|
|
Loading…
Reference in New Issue