DBNMQTTool: 增加 dld960/+/dev/# 订阅兼容旧固件多级 topic
旧固件响应发布到 dld960/{sn}/dev/config/resp 等多级路径,
单级通配 dld960/+/dev 无法匹配,# 通配确保向后兼容。
This commit is contained in:
@@ -70,6 +70,8 @@ class MqttClient:
|
||||
from .protocol import TOPIC_ALL_DEVICE_UP
|
||||
print(f"[MqttClient] auto-subscribe: {TOPIC_ALL_DEVICE_UP}", flush=True)
|
||||
client.subscribe(TOPIC_ALL_DEVICE_UP, qos=1)
|
||||
# 兼容旧固件多级 topic: dld960/{sn}/dev/config/resp 等
|
||||
client.subscribe("dld960/+/dev/#", qos=1)
|
||||
else:
|
||||
self._connected = False
|
||||
self._notify_status(False, f"连接失败 (rc={rc})")
|
||||
|
||||
Reference in New Issue
Block a user