Fix bug.
This commit is contained in:
parent
7c1c0a7377
commit
e05775f031
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user