From 944b87b6bcccb095cd73f13f4410fb20faf48f74 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 25 十二月 2019 11:21:06 +0800
Subject: [PATCH] 2019.12.25

---
 ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
index 0049e42..047aa8b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using Shared.Common;
 using Shared.Phone.Device.CommonForm;
+using Shared.Phone.Device.DeviceLogic;
 using Shared.Phone.UserView;
 using ZigBee.Device;
 namespace Shared.Phone.Device.Light
@@ -70,6 +71,10 @@
         /// </summary>
         private Button OffBtn;
 
+        /// <summary>
+        /// IsDrawerLockMode
+        /// </summary>
+        public bool IsDrawerLockMode;
         #endregion
 
         #region 鈼� 鎺ュ彛__________________________
@@ -169,7 +174,7 @@
                             return;
                         }
                         deviceUI.CommonDevice.IsOnline = common.IsOnline;
-                        OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
+                        //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
                         deviceUI.CommonDevice.LastDateTime = DateTime.Now;
                     }
                     catch (Exception ex)
@@ -191,6 +196,10 @@
             //action();
             //action = null;
             RemoveUpdateControlDeviceStatuAction();
+            if (IsDrawerLockMode)
+            {
+                CommonPage.Instance.IsDrawerLockMode = false;
+            }
             base.RemoveFromParent();
         }
 
@@ -228,8 +237,7 @@
             {
                 UserHomeView.ReadStatus(light, () =>
                 {
-                    light.ReadOnOffStatus();
-                    light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
+                    ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
                 });
             }
             else
@@ -237,8 +245,7 @@
                 //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
                 if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
                 {
-                    light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
-                    light.ReadOnOffStatus();
+                    ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
                 }
             }
 
@@ -341,7 +348,7 @@
                 Height = Application.GetRealHeight(60),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextGrayColor,
-                Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+                Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1)
             };
             itemView.AddChidren(StatuBtn);
 

--
Gitblit v1.8.0