From 031940a625d45379a2524fc0de274973eefd8f11 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Mon, 3 Jun 2024 01:01:09 +0200 Subject: [PATCH] Continue Flask migration. --- thermostat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thermostat.py b/thermostat.py index 76f9f09..ad4f3d2 100644 --- a/thermostat.py +++ b/thermostat.py @@ -199,13 +199,13 @@ class Set_mode_thermostat(Resource): @auth_required @api.expect(Set_mode_model, validate=True) def post(self): + global new_forced_mode try: data = Set_mode(**request.json) except Exception as e: logging.error(e) return "K0", 400 new_forced_mode = data.value - xprint(data) xprint(new_forced_mode) return "OK", 201 @@ -270,6 +270,7 @@ def thermostat_loop(): # dbconn.close() # break + xprint(new_forced_mode) if new_forced_mode is not None: with app.app_context(): data = Set_mode({"value": new_forced_mode})