From dfd3bdc07c49fab66b38382e0bbe7c91bdf4f15b Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 28 四月 2020 15:03:43 +0800
Subject: [PATCH] 合并新代码,提供逻辑需要的门锁接口

---
 ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
old mode 100755
new mode 100644
index 0515eab..746a189
--- a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
@@ -17,7 +17,7 @@
         {
             get
             {
-                if(_instance == null)
+                if (_instance == null)
                 {
                     _instance = new ReadDeviceAttributeLogic();
                 }
@@ -27,6 +27,56 @@
 
         #endregion
 
+        #region 鈼� 鏂伴____________________________
+        /// <summary>
+        /// SendFreshAirStatuComand
+        /// </summary>
+        /// <param name="device">璁惧</param>
+        public void SendFreshAirStatuComand(CommonDevice device)
+        {
+            if (device == null)
+            {
+                return;
+            }
+            new System.Threading.Thread(() =>
+            {
+                SendFreshAirFanStatuComand(device);
+                System.Threading.Thread.Sleep(300);
+            })
+            { IsBackground = true }.Start();
+        }
+
+        /// <summary>
+        /// SendFanStatuComand
+        /// </summary>
+        /// <param name="device">璁惧</param>
+        private void SendFreshAirFanStatuComand(CommonDevice device)
+        {
+            if (device == null)
+            {
+                return;
+            }
+            var jObject = new Newtonsoft.Json.Linq.JObject
+            {
+                { "DeviceAddr",device.DeviceAddr },
+                { "Epoint", device.DeviceEpoint },
+                { "Cluster_ID", (int)Cluster_ID.FanControl },
+                { "Command", 108 }
+            };
+            var attriBute = new Newtonsoft.Json.Linq.JArray
+            {
+               new Newtonsoft.Json.Linq.JObject
+               {
+                 { "AttriButeId", (int)AttriButeId.FanMode}
+               }
+            };
+            var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
+            jObject.Add("Data", data);
+            device.Gateway?.Send("GetDeviceStatus", jObject.ToString());
+        }
+
+        #endregion
+
         #region 鈼� 绌鸿皟____________________________
 
         /// <summary>

--
Gitblit v1.8.0