This commit is contained in:
xyj 2023-12-11 18:18:52 +08:00
parent e0761230f1
commit f866300b7b
3 changed files with 6 additions and 7 deletions

View File

@ -26,5 +26,4 @@ try:
t2 = LOT_DATA(**data) t2 = LOT_DATA(**data)
add(t2) add(t2)
except Exception as e: except Exception as e:
print(e)
pass pass

View File

@ -220,6 +220,6 @@ def test():
if __name__ == '__main__': if __name__ == '__main__':
# 正式环境 # 正式环境
# local() local()
# 测试环境 # 测试环境
test() # test()

View File

@ -191,7 +191,7 @@ def get_data():
client.publish(publish_topic, payload=json.dumps(data, ensure_ascii=False), qos=0) client.publish(publish_topic, payload=json.dumps(data, ensure_ascii=False), qos=0)
add(t2) add(t2)
except Exception as e: except Exception as e:
print(e) # print(e)
pass pass
@ -220,16 +220,16 @@ def p():
client.publish(publish_topic, payload=json.dumps(data, ensure_ascii=False), qos=0) client.publish(publish_topic, payload=json.dumps(data, ensure_ascii=False), qos=0)
add(t2) add(t2)
except Exception as e: except Exception as e:
print(e) # print(e)
pass pass
def on_connect(client, userdata, flags, rc): def on_connect(client, userdata, flags, rc):
if rc == 0: if rc == 0:
# 测试 # 测试
threading.Thread(target=p).start() # threading.Thread(target=p).start()
# 正式环境 # 正式环境
# threading.Thread(target=get_data).start() threading.Thread(target=get_data).start()
if __name__ == '__main__': if __name__ == '__main__':