Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Dec 22, 2023
2 parents 19693ec + 63a331f commit 179ed59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions myems-api/core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,10 @@ def on_put(req, resp, id_):

if 'set_value' not in new_values['data'].keys():
set_value = None
elif isinstance(new_values['data']['set_value'], float) or \
isinstance(new_values['data']['set_value'], int):
elif isinstance(new_values['data']['set_value'], float):
set_value = float(new_values['data']['set_value'])
elif isinstance(new_values['data']['set_value'], int):
set_value = int(new_values['data']['set_value'])
else:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_SET_VALUE')
Expand All @@ -452,7 +453,7 @@ def on_put(req, resp, id_):
"uuid": row[2],
"topic": row[3],
"payload": row[4],
"set_value": set_value if set_value else row[5]}
"set_value": set_value if set_value is not None else row[5]}

mqc = None
try:
Expand Down

0 comments on commit 179ed59

Please sign in to comment.