diff --git a/thermostat.py b/thermostat.py index 6befed7..9829fe7 100644 --- a/thermostat.py +++ b/thermostat.py @@ -208,18 +208,19 @@ class Status_thermostat(Resource): return result 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) @ns_thermostat.route('/set_verbosity') class Set_verbosity_thermostat(Resource): - #@api.expect(Set_verbosity_model, validate=True) @auth_required + @api.expect(Set_verbosity_model, validate=True) @api.marshal_with(Set_verbosity_model) - def put(self): + def put(self, value): print(api.payload) + print(value) return "OK", 201