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 | 27 ++++++--------------------- 1 files changed, 6 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 92b3442..4fe007b --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -296,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> @@ -373,17 +358,17 @@ } 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绌烘皵璐ㄩ噺浼犳劅鍣� + //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� IconPath = "Device/AirQualitySensorEpoint.png"; } else if (this.Type == DeviceType.FreshAirHumiditySensor) -- Gitblit v1.8.0