From 304dca51c28183a9dfc192c6b93ea1c00bdd5d97 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 01 七月 2020 15:00:40 +0800
Subject: [PATCH] 添加了写入功能类型

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs |   40 ++++++++++++++++++++++++++++++++--------
 1 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index 43ae483..1d991f4 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -199,12 +199,12 @@
                 {
                     return null;
                 }
-                var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.getGatewayBaseInfo != null) && (obj.getGatewayBaseInfo.gwID == CurrentGateWayId));
+                var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == CurrentGateWayId));
                 if (gateWay == null)
                 {
                     gateWay = new ZbGateway { IsVirtual = true, };
-                    gateWay.getGatewayBaseInfo.gwID = CurrentGateWayId;
-                    gateWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId;
+                    gateWay.GwId = CurrentGateWayId;
+                    gateWay.HomeId = Shared.Common.Config.Instance.HomeId;
                     ZbGateway.GateWayList.Add(gateWay);
                 }
 
@@ -248,9 +248,21 @@
             {
                 device = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight>(strDeviceByte);
             }
+            else if (strDeviceType == ZigBee.Device.DeviceType.ColorDimmerSwitch.ToString())
+            {
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmerSwitch>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.LevelControlSwitch.ToString())
+            {
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<LevelControlSwitch>(strDeviceByte);
+            }
             else if (strDeviceType == ZigBee.Device.DeviceType.WindowCoveringDevice.ToString())
             {
                 device = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.WindowCoveringController.ToString())
+            {
+                device = Newtonsoft.Json.JsonConvert.DeserializeObject<WindowCoveringController>(strDeviceByte);
             }
             else if (strDeviceType == ZigBee.Device.DeviceType.OnOffSwitch.ToString())
             {
@@ -299,6 +311,14 @@
             else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString())
             {
                 return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.ColorTemperatureLight.ToString())
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.Buzzer.ToString())
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<Buzzer>(strDeviceByte);
             }
             else { return null; }
             //鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓�
@@ -369,11 +389,11 @@
                 {
                     //璋冨厜鍣�
                     IconPath = "Device/Light.png";
-                    if (Shared.Common.LocalDevice.Current.IsMiniLight(this) == true)
-                    {
-                        //mini澶滅伅
-                        IconPath = "Device/MiniNightLight.png";
-                    }
+                }
+                else if (this.Type == DeviceType.ColorTemperatureLight)
+                {
+                    //鑹叉俯鐏�
+                    IconPath = "Device/ColorLightTemperature.png";
                 }
                 else if (this.Type == DeviceType.OnOffOutput)
                 {
@@ -667,6 +687,10 @@
             /// 濂藉儚鏄簭鍒楀彿
             /// </summary>
             public string ProductCode = string.Empty;
+            /// <summary>
+            /// 璁惧鍔熻兘绫诲瀷(绌烘皵寮�鍏冲拰缁х數鍣ㄤ笓鐢�)
+            /// </summary>
+            public int FunctionType = -1;
             /// <summary>
             /// 杈撳叆绨囧垪琛�
             /// </summary>

--
Gitblit v1.8.0