Fix API response codes.

This commit is contained in:
yohan 2024-06-08 11:24:10 +02:00
parent 288e371865
commit 7b168601ec

View File

@ -212,7 +212,7 @@ class Set_mode_thermostat(Resource):
except Exception as e: except Exception as e:
logging.error(e) logging.error(e)
return "K0", 400 return "K0", 400
return "OK", 201 return "OK", 200
@ns_thermostat.route('/status') @ns_thermostat.route('/status')
class Status_thermostat(Resource): class Status_thermostat(Resource):
@ -246,7 +246,7 @@ class Set_verbosity_thermostat(Resource):
logging.getLogger().setLevel(logging.WARNING) logging.getLogger().setLevel(logging.WARNING)
else: else:
return "Bad request", 400 return "Bad request", 400
return "OK", 201 return "OK", 200
except Exception as e: except Exception as e:
logging.error(e) logging.error(e)
return "K0", 400 return "K0", 400