Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
1708639776959.sdttutorial | 2e10db1321 |
4
main.py
4
main.py
|
@ -4,7 +4,7 @@ import uuid
|
||||||
import random
|
import random
|
||||||
|
|
||||||
sdtcloud = sdtcloudpubsub.sdtcloudpubsub()
|
sdtcloud = sdtcloudpubsub.sdtcloudpubsub()
|
||||||
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:
|
||||||
|
@ -19,7 +19,7 @@ def runAction():
|
||||||
"value": random.randint(100, 1000)
|
"value": random.randint(100, 1000)
|
||||||
|
|
||||||
}]
|
}]
|
||||||
sdtcloud.pubMessage(mqttClient, msg)
|
sdtcloud.pubMessage(msg)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue