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 |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 5d85428..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,7 +310,17 @@
 
             MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}");
 
-            //useRemote = true;
+            ///绗笁鏂规秱楦﹁澶囩粺涓�浣跨敤杩滅▼鎺у埗
+            switch(function.spk)
+            {
+                case SPK.ElectricTuyaAirCleaner:
+                case SPK.ElectricTuyaFan:
+                case SPK.ElectricTuyaWaterValve:
+                case SPK.ElectricTuyaWeepRobot:
+                    useRemote = true;
+                    break;
+            }
+
             //杩滅▼閫氳
             if (Ins.IsRemote || useRemote == true)
             {
@@ -343,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}");
                 }
             }
         }
@@ -452,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);
                 }
             }

--
Gitblit v1.8.0