| | |
| | | }
|
| | | 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)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|