update
This commit is contained in:
parent
3107d92359
commit
2f946bc460
|
@ -196,7 +196,7 @@ def t():
|
|||
pass
|
||||
|
||||
|
||||
def test():
|
||||
def p():
|
||||
while True:
|
||||
time.sleep(10)
|
||||
try:
|
||||
|
@ -219,7 +219,7 @@ def test():
|
|||
'device_name': device_name
|
||||
}
|
||||
t2 = LOT_DATA(**data)
|
||||
# client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
|
||||
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
|
||||
add(t2)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@ -227,7 +227,8 @@ def test():
|
|||
|
||||
|
||||
def on_connect(client, userdata, flags, rc):
|
||||
threading.Thread(target=test).start()
|
||||
if rc == 0:
|
||||
threading.Thread(target=p).start()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue