Update main.py
This commit is contained in:
parent
7d0fb5272d
commit
1e129bf0b9
4
main.py
4
main.py
|
@ -4,7 +4,7 @@ import uuid
|
||||||
import random
|
import random
|
||||||
|
|
||||||
sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt()
|
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():
|
def runAction():
|
||||||
while True:
|
while True:
|
||||||
|
@ -13,7 +13,7 @@ def runAction():
|
||||||
"device_type": "gas",
|
"device_type": "gas",
|
||||||
"pulse_count": random.randint(0, 1)
|
"pulse_count": random.randint(0, 1)
|
||||||
}]
|
}]
|
||||||
sdtcloud.pubMessage(mqttClient, msg)
|
sdtcloud.pubMessage(msg)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue