From cca9ba03381aaf0ddb599eaa0e0c632c2cfff09a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 22 九月 2020 10:36:44 +0800
Subject: [PATCH] 代码还原回来

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index bda2e51..9a3120f 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -320,17 +320,28 @@
             }
             else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString())
             {
-                return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
             }
             else if (strDeviceType == ZigBee.Device.DeviceType.ColorTemperatureLight.ToString())
             {
-                return Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte);
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte);
             }
             else if (strDeviceType == ZigBee.Device.DeviceType.Buzzer.ToString())
             {
-                return Newtonsoft.Json.JsonConvert.DeserializeObject<Buzzer>(strDeviceByte);
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<Buzzer>(strDeviceByte);
             }
-            else { return null; }
+            else if (strDeviceType == ZigBee.Device.DeviceType.ColorDimmableLight.ToString())
+            {
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmableLight>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.DimmerSwitch.ToString())
+            {
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmerSwitch>(strDeviceByte);
+            }
+            else
+            {
+                return null;
+            }
             //鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓�
             device.Type = (DeviceType)device.DeviceID;
 

--
Gitblit v1.8.0