update
This commit is contained in:
parent
5f4b7fc91a
commit
0d3077ad02
10
MQTT.py
10
MQTT.py
|
@ -30,11 +30,11 @@ def valid(msg, client):
|
||||||
|
|
||||||
# Message receiving callback
|
# Message receiving callback
|
||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
if not valid(msg, client):
|
# if not valid(msg, client):
|
||||||
# print("验证失败")
|
# # print("验证失败")
|
||||||
return
|
# return
|
||||||
# print("验证通过")
|
# # print("验证通过")
|
||||||
client.publish('error', payload='通过', qos=0)
|
# client.publish('error', payload='通过', qos=0)
|
||||||
try:
|
try:
|
||||||
origin_data = json.loads(msg.payload.decode('utf-8'))
|
origin_data = json.loads(msg.payload.decode('utf-8'))
|
||||||
data = origin_data["msg"]
|
data = origin_data["msg"]
|
||||||
|
|
Loading…
Reference in New Issue