Update main.py

This commit is contained in:
1708639776959.sdtroot 2024-04-30 05:57:35 +00:00
parent 7d0fb5272d
commit 1e129bf0b9
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import uuid
import random
sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
mqttClient = sdtcloud.setClient(f"device-app-{uuid.uuid1()}") # parameter is client ID(string)
sdtcloud.setClient(f"device-app-{uuid.uuid1()}") # parameter is client ID(string)
def runAction():
while True:
@ -13,7 +13,7 @@ def runAction():
"device_type": "gas",
"pulse_count": random.randint(0, 1)
}]
sdtcloud.pubMessage(mqttClient, msg)
sdtcloud.pubMessage(msg)
time.sleep(10)
if __name__ == "__main__":