sampyo-dio/main.py

19 lines
395 B
Python
Raw Permalink Normal View History

2024-03-26 05:13:12 +00:00
import sdtcloudpubsub
import time
import uuid
sdtcloud = sdtcloudpubsub.sdtcloudpubsub()
mqttClient = sdtcloud.setClient(f"device-app-{uuid.uuid1()}") # parameter is client ID(string)
def runAction():
while True:
msg = {
"message": "Hello World"
}
sdtcloud.pubMessage(mqttClient, msg)
time.sleep(2)
if __name__ == "__main__":
runAction()