Update main.py
This commit is contained in:
parent
41c2b93858
commit
48198075f1
4
main.py
4
main.py
|
@ -3,14 +3,14 @@ import time
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
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:
|
||||||
msg = {
|
msg = {
|
||||||
"message": "Hello World"
|
"message": "Hello World"
|
||||||
}
|
}
|
||||||
sdtcloud.pubMessage(mqttClient, msg)
|
sdtcloud.pubMessage(msg)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue