From e5f993f52e09eb46878baced83bb8492f147d41c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 04 十一月 2019 17:58:40 +0800
Subject: [PATCH] 2019-11-04-1

---
 ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs b/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
old mode 100644
new mode 100755
index 3157a0d..ecb3c7e
--- a/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
@@ -126,10 +126,10 @@
                         }
                         if (deviceUI.CommonDevice.Type == DeviceType.AirSwitch)
                         {
-                            if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
+                            if (common.DeviceStatusReport.CluterID == 6)
                             {
                                 var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
-                                airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
+                                airSwitch.DeviceStatusReport = common.DeviceStatusReport;
                                 //璁板綍銆佹洿鏂扮姸鎬�
                                 if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
                                 {
@@ -140,7 +140,7 @@
                                 airSwitch.LastDateTime = DateTime.Now;
                             }
                             //***鏂版敼***璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID=3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                            else if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
+                            else if (common.DeviceStatusReport.CluterID == 3)
                             {
                                 var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
                                 airSwitch.IsOnline = 1;
@@ -204,7 +204,7 @@
         public override void RemoveFromParent()
         {
             ZbGateway.StatusList.Remove(this);
-            action();
+            action?.Invoke();
             RemoveUpdateControlDeviceStatuAction();
             base.RemoveFromParent();
         }
@@ -490,7 +490,6 @@
                 Shared.Common.Room.Lists[0].AddDevice(device.FileName);
                 collectionBtn.IsSelected = true;
             }
-            action?.Invoke();
         }
 
         /// <summary>

--
Gitblit v1.8.0