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')