From 136b9e2fc48249a5ff89874f1080ba94130e7a9e Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 19 五月 2020 11:12:29 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into dev-2020xm

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

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index 4fe007b..8bf4381 100644
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -300,7 +300,26 @@
             {
                 return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
             }
-            return null;
+            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)
+            {
+                return null;
+            }
+            return CommonDeviceByByteString(v[1], System.Text.Encoding.UTF8.GetString(Shared.Common.Global.ReadFileByHomeId(deviceFilePath)));
         }
 
         /// <summary>
@@ -457,6 +476,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