From cf0bffdf072bae11bdb8c780d0a355818700f713 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 18 五月 2020 15:42:45 +0800
Subject: [PATCH] 请合并代码,优化面板问题

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

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
old mode 100755
new mode 100644
index a572e70..9e2afc2
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -108,7 +108,12 @@
         /// 0锛氳澶囦笉鍦ㄧ嚎
         /// <para>1锛氳澶囧湪绾�</para>
         /// </summary>
-        public int IsOnline;
+        public int IsOnline;
+        /// <summary>
+        /// 1锛氳矾鐢辫澶�
+        /// <para>2锛氱粓绔澶囷紝鐢垫睜璁惧</para>
+        /// </summary>
+        public int ZigbeeType;
         /// <summary>
         /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭
         /// </summary>
@@ -291,11 +296,11 @@
             {
                 device = Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte);
             }
-            else { return null; }
-            //鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓�
-            device.Type = (DeviceType)device.DeviceID;
-
-            return device;
+            else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString())
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
+            }
+            return null;
         }
 
         /// <summary>
@@ -368,13 +373,18 @@
                 }
                 else if (this.Type == DeviceType.Thermostat)
                 {
-                    //绌鸿皟 
+                    //绌鸿皟
                     IconPath = "Device/AirConditionerEpoint.png";
                 }
                 else if (this.Type == DeviceType.FreshAir)
                 {
-                    //鏂伴 
+                    //鏂伴
                     IconPath = "Device/FreshAirEpoint.png";
+                }
+                else if (this.Type == DeviceType.PMSensor)
+                {
+                    //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
+                    IconPath = "Device/AirQualitySensorEpoint.png";
                 }
                 else if (this.Type == DeviceType.FreshAirHumiditySensor)
                 {
@@ -462,6 +472,8 @@
             /// 娓╁害娴嬮噺鍔熻兘鐨勮澶囧锛氭俯搴︿紶鎰熷櫒銆傘�傘��
             /// <para>1029:Relative Humidity Measurement,璁惧鏀寔鈥滄箍搴︽祴閲忓姛鑳解��</para>
             /// 婀垮害娴嬮噺鍔熻兘鐨勮澶囧锛氭箍搴︿紶鎰熷櫒銆傘�傘��
+            /// <para>1066:Pm2.5  Measurement,璁惧鏀寔鈥減m2.5娴嬮噺鍔熻兘鈥�</para>
+            /// Pm2.5娴嬮噺鍔熻兘鐨勮澶囧锛歅m2.5浼犳劅鍣ㄣ�傘�傘��
             /// </summary>
             public int InCluster;
         }

--
Gitblit v1.8.0