This commit is contained in:
xyj 2024-01-13 11:40:28 +08:00
parent 656f97c0be
commit 23d664774f
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class MQTTClient:
self.username = username
self.password = password
# 千万不要指定client_id 不然死翘翘
self.client = mqtt.Client(client_id="测试")
self.client = mqtt.Client(client_id=subscribe_topic)
self.client.username_pw_set(self.username, self.password)
self.client.on_connect = self.on_connect
self.client.on_message = self.on_message