19 lines
370 B
Python
19 lines
370 B
Python
import sdtcloudpubsub
|
|
import time
|
|
import uuid
|
|
|
|
sdtcloud = sdtcloudpubsub.sdtcloudpubsub()
|
|
sdtcloud.setClient(f"device-app-{uuid.uuid1()}") # parameter is client ID(string)
|
|
|
|
def runAction():
|
|
while True:
|
|
msg = {
|
|
"message": "Hello World"
|
|
}
|
|
sdtcloud.pubMessage(msg)
|
|
time.sleep(2)
|
|
|
|
if __name__ == "__main__":
|
|
runAction()
|
|
|