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/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 79 ++++++++++++++++++++++++++++++++------- 1 files changed, 65 insertions(+), 14 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs index 89e7821..482c652 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -154,21 +154,21 @@ } return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%"; } - else if (device.Type == DeviceType.FreshAir) - { - //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 + else if (device.Type == DeviceType.FreshAir) + { + //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 if (device.HadReadDeviceStatu == false) { return Language.StringByID(R.MyInternationalizationString.uOffLine); - } - - //妯″紡 - string wind = string.Empty; - var freshAir = device as FreshAir; - if (freshAir.currentFanStatus == 0) - { - return Language.StringByID(R.MyInternationalizationString.Close); - } + } + + //妯″紡 + string wind = string.Empty; + var freshAir = device as FreshAir; + if (freshAir.currentFanStatus == 0) + { + return Language.StringByID(R.MyInternationalizationString.Close); + } if (freshAir.currentFanSpeed == 1) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); @@ -180,8 +180,59 @@ else if (freshAir.currentFanSpeed == 3) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); - } - return $"{wind}"; + } + return $"{wind}"; + } + else if (device.Type == DeviceType.PMSensor) + { + //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 + if (device.HadReadDeviceStatu == false) + { + return Language.StringByID(R.MyInternationalizationString.uOffLine); + } + //绌烘皵璐ㄩ噺 + string curQuality = ""; + //娓╁害 + string temperature = string.Empty; + //婀垮害 + string humidity = string.Empty; + //PM2.5 + string pm = string.Empty; + var pMSensor = device as PMSensor; + if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData > 250) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else + { + curQuality = "--"; + } + + humidity = $"{pMSensor.currentHumidity}%"; + temperature = $"{pMSensor.currentTemperature}鈩�"; + pm = $"{pMSensor.currentPmData}渭g/m鲁"; + return $"{curQuality},{pm},{temperature},{humidity}"; + } else if (device.Type == DeviceType.Thermostat) { -- Gitblit v1.8.0