提交 3615273f 编写于 作者: nengyuangzhang's avatar nengyuangzhang

fixed set_value issue for command in myems-api

上级 63a331fb
......@@ -465,10 +465,10 @@ class CommandSend:
description='API.MQTT_CONNECTION_ERROR')
try:
if command['set_value']:
if command['set_value'] is not None:
payload = Template(command['payload']).substitute(s1=str(command['set_value']))
else:
payload = command['payload']
payload = Template(command['payload']).substitute(s1=str(0))
print('payload=' + str(payload))
mqc.publish(command['topic'], payload=payload)
except Exception as e:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册