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)
|
@api.expect(Set_mode_model, validate=True)
|
||||||
def post(self):
|
def post(self):
|
||||||
global new_forced_mode
|
global new_forced_mode
|
||||||
|
#try:
|
||||||
|
# data = Set_mode(**request.json)
|
||||||
|
#except Exception as e:
|
||||||
|
# logging.error(e)
|
||||||
|
# return "K0", 400
|
||||||
try:
|
try:
|
||||||
data = Set_mode(**request.json)
|
new_forced_mode = data.value
|
||||||
|
xprint(new_forced_mode)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(e)
|
logging.error(e)
|
||||||
return "K0", 400
|
return "K0", 400
|
||||||
new_forced_mode = data.value
|
|
||||||
xprint(new_forced_mode)
|
|
||||||
return "OK", 201
|
return "OK", 201
|
||||||
|
|
||||||
@ns_thermostat.route('/status')
|
@ns_thermostat.route('/status')
|
||||||
|
Loading…
Reference in New Issue
Block a user