From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 01 六月 2020 14:59:39 +0800 Subject: [PATCH] 上传一个合并的版本 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 52 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs index 6fbdb9e..c2a0213 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -135,7 +135,7 @@ { return Language.StringByID(R.MyInternationalizationString.uOffLine); } - if ((device as DimmableLight).OnOffStatus == 0 || (device as DimmableLight).Level == 0) + if ((device as DimmableLight).OnOffStatus == 0) { return Language.StringByID(R.MyInternationalizationString.Close); } @@ -183,6 +183,57 @@ } 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