Continue Flask migration.

This commit is contained in:
yohan 2024-06-02 23:56:28 +02:00
parent 41c98d2b42
commit d78296774d

View File

@ -208,18 +208,19 @@ class Status_thermostat(Resource):
return result return result
Set_verbosity_resource_fields = { Set_verbosity_resource_fields = {
'value': fields.String(required=True, description='Verbosity', enum=[logging.DEBUG, logging.INFO, logging.WARNING]) 'value': fields.String(required=True, description='Verbosity', enum=["DEBUG", "INFO", "WARNING"])
} }
Set_verbosity_model = api.model('Set_verbosity_Model', Set_verbosity_resource_fields) Set_verbosity_model = api.model('Set_verbosity_Model', Set_verbosity_resource_fields)
@ns_thermostat.route('/set_verbosity') @ns_thermostat.route('/set_verbosity')
class Set_verbosity_thermostat(Resource): class Set_verbosity_thermostat(Resource):
#@api.expect(Set_verbosity_model, validate=True)
@auth_required @auth_required
@api.expect(Set_verbosity_model, validate=True)
@api.marshal_with(Set_verbosity_model) @api.marshal_with(Set_verbosity_model)
def put(self): def put(self, value):
print(api.payload) print(api.payload)
print(value)
return "OK", 201 return "OK", 201