大棚逻辑完善 接入真实数据

监听全部数据,后期改成只监听用户下的设备
master
lld 2025-12-26 00:47:20 +08:00
parent fad3d3ad55
commit 172e5cb894
1 changed files with 4 additions and 3 deletions

View File

@ -477,7 +477,7 @@ export default {
this.value=1; this.value=1;
} }
this.reset(); this.reset();
this.disconnectMqtt(); // this.disconnectMqtt();
}, },
reset() { reset() {
@ -581,7 +581,7 @@ export default {
this.client.on('connect', () => { this.client.on('connect', () => {
this.connected = true this.connected = true
this.client.subscribe(this.mqttConfig.subscribeTopic, { qos: 0 }) this.client.subscribe('dtu/+/up', { qos: 0 })
this.addMessage('已连接到MQTT服务器') this.addMessage('已连接到MQTT服务器')
}) })
@ -633,7 +633,7 @@ export default {
}, },
ackMessage(topic, payload) { ackMessage(topic, payload) {
console.info("处理回执消息")
// console.info(""+topic,payload) // console.info(""+topic,payload)
// 1. dtu/xxx/up // 1. dtu/xxx/up
@ -650,6 +650,7 @@ export default {
// console.info(""+msgData) // console.info(""+msgData)
// 3. // 3.
if (msgData.prop && "suc" in msgData) { if (msgData.prop && "suc" in msgData) {
console.info("处理回执消息")
// 👉 // 👉
this.handleCommandAck(msgData,this.deviceType); this.handleCommandAck(msgData,this.deviceType);
} }