From abf4a98837e43e542701c60b7ec6a088cd5236da Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 22 二月 2021 09:10:35 +0800 Subject: [PATCH] 20210222 --- HDL_ON/DAL/DriverLayer/Control.cs | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 91f0f1b..20d2fa3 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -207,9 +207,9 @@ } else if (MainPage.InternetStatus == 1) { - if (!Ins.IsRemote) + //if (!Ins.IsRemote) { - Ins.IsRemote = true; + //Ins.IsRemote = true; DAL.Mqtt.MqttClient.InitState(); } } @@ -310,6 +310,17 @@ MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); + ///绗笁鏂规秱楦﹁澶囩粺涓�浣跨敤杩滅▼鎺у埗 + switch(function.spk) + { + case SPK.ElectricTuyaAirCleaner: + case SPK.ElectricTuyaFan: + case SPK.ElectricTuyaWaterValve: + case SPK.ElectricTuyaWeepRobot: + useRemote = true; + break; + } + //杩滅▼閫氳 if (Ins.IsRemote || useRemote == true) { @@ -342,7 +353,7 @@ var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id); - MainPage.Log($"鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}"); + MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}"); } } } @@ -400,6 +411,10 @@ if(temp!= null) { temp = function; + if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(temp.spk)) + { + Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(temp.sid, temp.status); + } } } } @@ -447,7 +462,7 @@ }; var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(readDataObj); var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadStatus, functionControlDataJson); - MainPage.Log($"鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}"); + MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}"); new Control_Udp().SendLocalHdlLinkData(sendBytes, readDataObj.id); } } @@ -906,7 +921,7 @@ case SPK.ElectricTuyaWeepRobot: case SPK.ElectricTuyaWaterValve: //璁惧鐘舵�佹帹閫� - var myDevice = Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp); + var myDevice = Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid,updateTemp.status); if (myDevice != null) { localObj = myDevice; -- Gitblit v1.8.0