Continue Flask migration.
This commit is contained in:
parent
ac35a37788
commit
41d23b9bd8
@ -190,7 +190,14 @@ class Set_mode_thermostat(Resource):
|
||||
def post(self):
|
||||
try:
|
||||
data = Set_mode(**request.json)
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
return "K0", 400
|
||||
try:
|
||||
db.session.add(data)
|
||||
except sqlite3.IntegrityError:
|
||||
logging.error("catched")
|
||||
try:
|
||||
db.session.commit()
|
||||
return "OK", 201
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user