From 99da2604f81af29afc6b3c6f4f128b4e5a8a5649 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 13 五月 2020 12:00:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into dev-2020xm

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs |   37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 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..4fe007b
--- 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,26 +296,11 @@
             {
                 device = Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte);
             }
-            else { return null; }
-            //鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓�
-            device.Type = (DeviceType)device.DeviceID;
-
-            return device;
-        }
-
-        /// <summary>
-        /// 鐢辫澶囪矾寰勬仮澶嶈澶囧璞�
-        /// </summary>
-        /// <returns>The device by file path.</returns>
-        /// <param name="deviceFilePath">Device file path.</param>
-        public static CommonDevice CommonDeviceByFilePath(string deviceFilePath)
-        {
-            var v = deviceFilePath.Split('_');
-            if (v.Length < 3)
+            else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString())
             {
-                return null;
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
             }
-            return CommonDeviceByByteString(v[1], System.Text.Encoding.UTF8.GetString(Shared.Common.Global.ReadFileByHomeId(deviceFilePath)));
+            return null;
         }
 
         /// <summary>
@@ -368,14 +358,19 @@
                 }
                 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)
                 {
                     //婀垮害浼犳劅鍣�

--
Gitblit v1.8.0