This commit is contained in:
xyj 2023-12-11 16:57:21 +08:00
parent 17ae017821
commit a90818cdb3
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class MQTTClient:
def on_connect(self, client, userdata, flags, rc): def on_connect(self, client, userdata, flags, rc):
if rc == 0: if rc == 0:
self.client.subscribe(self.topic) self.client.subscribe(self.topic)
client.publish('success', payload='成功订阅' + 'device_name' + ',time=' + str(datetime.datetime.now()), client.publish('success', payload='成功订阅' + subscribe_topic + ',time=' + str(datetime.datetime.now()),
qos=0) qos=0)
def on_message(self, client, userdata, msg): def on_message(self, client, userdata, msg):