| | |
| | | }
|
| | | else if (device.Type == DeviceType.PMSensor)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | //空气质量
|
| | | string curQuality = "";
|
| | | //温度
|
| | |
| | | var tempera = device as TemperatureSensor;
|
| | | if (tempera.SensorDiv == 1)
|
| | | {
|
| | | if (tempera.Temperatrue == 0)
|
| | | if (tempera.currentTemperature == 0)
|
| | | {
|
| | | return "--℃";
|
| | | return "0.0℃";
|
| | | }
|
| | | return $"{tempera.Temperatrue}℃";
|
| | | return $"{tempera.currentTemperature}℃";
|
| | | }
|
| | | else if (tempera.SensorDiv == 2)
|
| | | {
|
| | | if (tempera.Humidity == 0)
|
| | | if (tempera.currentHumidity == 0)
|
| | | {
|
| | | return "--%";
|
| | | }
|
| | | return $"{tempera.Humidity}%";
|
| | | return $"{tempera.currentHumidity}%";
|
| | | }
|
| | | return null;
|
| | | }
|