fix send_command payloadType
Used toType instead of payloadType...
This commit is contained in:
parent
e233fe933e
commit
5ac6663502
2 changed files with 4 additions and 5 deletions
|
|
@ -183,12 +183,12 @@ class MQTTHelperBot:
|
||||||
cmdjson["payloadType"],
|
cmdjson["payloadType"],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
if cmdjson["toType"] == "x":
|
if cmdjson["payloadType"] == "x":
|
||||||
await self.Client.publish(
|
await self.Client.publish(
|
||||||
ttopic, str(cmdjson["payload"]).encode(), QOS_0
|
ttopic, str(cmdjson["payload"]).encode(), QOS_0
|
||||||
)
|
)
|
||||||
|
|
||||||
if cmdjson["toType"] == "j":
|
if cmdjson["payloadType"] == "j":
|
||||||
await self.Client.publish(
|
await self.Client.publish(
|
||||||
ttopic, json.dumps(cmdjson["payload"]).encode(), QOS_0
|
ttopic, json.dumps(cmdjson["payload"]).encode(), QOS_0
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -348,9 +348,8 @@ async def test_helperbot_sendcommand():
|
||||||
0.2
|
0.2
|
||||||
) # Override wait_resp_timeout (so we don't wait 10 seconds for timeout)
|
) # Override wait_resp_timeout (so we don't wait 10 seconds for timeout)
|
||||||
# Send response beforehand
|
# Send response beforehand
|
||||||
msg_payload = (
|
msg_payload = '{"body":{"code":0,"data":{"area":0,"cid":"111","start":"1569378657","time":6,"type":"auto"},"msg":"ok"},"header":{"fwVer":"1.6.4","hwVer":"0.1.1","pri":1,"ts":"1569380074036","tzm":480,"ver":"0.0.1"}}'
|
||||||
'{"body":{"code":0,"data":{"area":0,"cid":"111","start":"1569378657","time":6,"type":"auto"},"msg":"ok"},"header":{"fwVer":"1.6.4","hwVer":"0.1.1","pri":1,"ts":"1569380074036","tzm":480,"ver":"0.0.1"}}'
|
|
||||||
)
|
|
||||||
msg_topic_name = (
|
msg_topic_name = (
|
||||||
"iot/p2p/getStats/bot_serial/ls1ok3/wC3g/helper1/bumper/helper1/p/testj/j"
|
"iot/p2p/getStats/bot_serial/ls1ok3/wC3g/helper1/bumper/helper1/p/testj/j"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue