From 7dd4be37cdedaf81ad40990d8cb8dce164d83f4d Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 19 五月 2020 10:31:16 +0800 Subject: [PATCH] 34444444 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs index 6fbdb9e..482c652 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -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