This commit is contained in:
yohan 2024-06-06 13:17:03 +02:00
parent 7c1c0a7377
commit e05775f031

View File

@ -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)
return "OK", 201
@ns_thermostat.route('/status')