From e05775f03187fb94de04a294ec5a7447facbc854 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Thu, 6 Jun 2024 13:17:03 +0200 Subject: [PATCH] Fix bug. --- thermostat.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/thermostat.py b/thermostat.py index f4b1387..2e24617 100644 --- a/thermostat.py +++ b/thermostat.py @@ -210,13 +210,17 @@ class Set_mode_thermostat(Resource): @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 try: - data = Set_mode(**request.json) + new_forced_mode = data.value + xprint(new_forced_mode) except Exception as e: - logging.error(e) - return "K0", 400 - new_forced_mode = data.value - xprint(new_forced_mode) + logging.error(e) + return "K0", 400 return "OK", 201 @ns_thermostat.route('/status')