From d78296774da70f7415d3b801dac9acd7dbc32891 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sun, 2 Jun 2024 23:56:28 +0200 Subject: [PATCH] Continue Flask migration. --- thermostat.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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