From 1e129bf0b984f6a68bfd155b4de6a7760893ac60 Mon Sep 17 00:00:00 2001 From: "1708639776959.sdtroot" Date: Tue, 30 Apr 2024 05:57:35 +0000 Subject: [PATCH] Update main.py --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 98e7cc4..73f9b2c 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ import uuid import random 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(): while True: @@ -13,7 +13,7 @@ def runAction(): "device_type": "gas", "pulse_count": random.randint(0, 1) }] - sdtcloud.pubMessage(mqttClient, msg) + sdtcloud.pubMessage(msg) time.sleep(10) if __name__ == "__main__":