diff --git a/app.py b/app.py index 223ab82..51b345a 100644 --- a/app.py +++ b/app.py @@ -97,7 +97,7 @@ def run_recipes(): updateState() sleep(1) -def read_esnsors(): +def read_sensors(): while True: sensors.read() socketio.emit('sensors', (sensors.get(),)) @@ -107,7 +107,7 @@ import threading if __name__ == '__main__': thread = threading.Thread(target=run_recipes, daemon=True) thread.start() - sensors_thread = threading.Thread(target=read_esnsors, daemon=True) + sensors_thread = threading.Thread(target=read_sensors, daemon=True) sensors_thread.start() print('RUN APP') socketio.run(app, host='0.0.0.0') diff --git a/phasectrl.py b/phasectrl.py index 50a7792..bd9a527 100644 --- a/phasectrl.py +++ b/phasectrl.py @@ -126,7 +126,6 @@ class State(): for sensor in self.envdata.get('sensors', ()): _, ctrl, target = self.envdata['sensors'][sensor] self.envdata['sensors'][sensor] = (get_sensor_value(sensor), ctrl, target) - print(self.envdata) # Apply actuators for controller in self.envdata.get('controllers', {}).keys(): ctrl = self.envdata['controllers'][controller] @@ -134,6 +133,7 @@ class State(): print(f'Missing sensor {ctrl.input_label}') continue response = ctrl.apply(self.envdata['sensors'][ctrl.input_label][0]) + actuators[controller].enable(response) if self.check(): if self.next() is None: return True