| | |
| | | {
|
| | | if (device.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | if ((device as ToggleLight).OnOffStatus == 1)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOpen1);
|
| | |
| | | }
|
| | | else if (device.Type == DeviceType.AirSwitch)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | if ((device as AirSwitch).OnOffStatus == 1)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOpen1);
|
| | |
| | | }
|
| | | else if (device.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | if ((device as DimmableLight).OnOffStatus == 0 || (device as DimmableLight).Level == 0)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.Close);
|
| | |
| | | }
|
| | | else if (device.Type == DeviceType.WindowCoveringDevice)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | if ((device as Rollershade).WcdCurrentPositionLiftPercentage == 0)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.Close);
|
| | | }
|
| | | return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%";
|
| | | }
|
| | | 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);
|
| | | }
|
| | | if (freshAir.currentFanSpeed == 1)
|
| | | {
|
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Low);
|
| | | }
|
| | | else if (freshAir.currentFanSpeed == 2)
|
| | | {
|
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle);
|
| | | }
|
| | | else if (freshAir.currentFanSpeed == 3)
|
| | | {
|
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Height);
|
| | | }
|
| | | 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)
|
| | | {
|
| | | //在网关没有回复之前,默认离线
|
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | }
|
| | | //温度,模式,风速
|
| | | string tempareture = string.Empty;
|
| | | string model = string.Empty;
|
| | |
| | | else if (ac.currentSystemMode == 1)
|
| | | {
|
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_Auto);
|
| | | tempareture = $"{ac.currentCoolingSetpoint} ℃";
|
| | | tempareture = $"{ac.currentAutoSetpoint} ℃";
|
| | | }
|
| | | else if (ac.currentSystemMode == 3)
|
| | | {
|