Test api.doc.

This commit is contained in:
yohan 2024-06-07 19:05:36 +02:00
parent a8d7e7d93c
commit 503d1ffc32

View File

@ -200,18 +200,17 @@ Set_mode_resource_fields = {
} }
Set_mode_model = api.model('Set_mode_Model', Set_mode_resource_fields) Set_mode_model = api.model('Set_mode_Model', Set_mode_resource_fields)
#TODO: Add this to swagger documentation set_mode_description = 'Temporary forced modes (will stay in effect for '+str(int(forced_mode_duration))+' seconds):\n'\
#'Temporary forced modes (will stay in effect for '+str(int(forced_mode_duration))+' seconds):\n'\ +'\n'.join(['# /'+target+'\n' for target in targets])\
#+'\n'.join(['# /'+target+'\n' for target in targets])\ +'\n'\
#+'\n'\ +'Permanent forced modes:\n'\
#+'Permanent forced modes:\n'\ +'\n'.join(['# /'+mode+'\n' for mode in modes])
#+'\n'.join(['# /'+mode+'\n' for mode in modes])
@ns_thermostat.route('/set_mode') @ns_thermostat.route('/set_mode')
class Set_mode_thermostat(Resource): class Set_mode_thermostat(Resource):
@auth_required @auth_required
@api.expect(Set_mode_model, validate=True) @api.expect(Set_mode_model, validate=True)
@api.doc(description="My resource") @api.doc(description=set_mode_description)
def post(self): def post(self):
global new_forced_mode global new_forced_mode
try: try: