| | |
| | | |
| | | this.room = r; |
| | | |
| | | this.temperDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | this.temperDevice = HdlDeviceCommonLogic.Current.GetDevice(room.TemperatrueDevice); |
| | | |
| | | this.humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); |
| | | this.humidDevice = HdlDeviceCommonLogic.Current.GetDevice(room.HumidityDevice); |
| | | |
| | | var roomBackView = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | if (this.temperDevice != null) |
| | | {
|
| | | //这个设备要存在本地才行
|
| | | { |
| | | //这个设备要存在本地才行 |
| | | decimal temperatrue = (decimal)temperDevice.GetType().InvokeMember("currentTemperature", System.Reflection.BindingFlags.GetField, null, temperDevice, null); |
| | | temperatureText.Text = temperatrue == 0 ? "0.0℃" : temperatrue.ToString() + "℃"; |
| | | } |
| | |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | |
|
| | | |
| | | if (this.humidDevice != null) |
| | | {
|
| | | //这个设备要存在本地才行
|
| | | { |
| | | //这个设备要存在本地才行 |
| | | decimal humidity = (decimal)humidDevice.GetType().InvokeMember("currentHumidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); |
| | | humidityText.Text = humidity == 0 ? "0.0%" : humidity.ToString() + "%"; |
| | | } |
| | |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | //发送获取温度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | var dev = HdlDeviceCommonLogic.Current.GetDevice(room.TemperatrueDevice); |
| | | HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(dev); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); |
| | | var dev = HdlDeviceCommonLogic.Current.GetDevice(room.HumidityDevice); |
| | | HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(dev); |
| | | } |
| | | |
| | |
| | | if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | {
|
| | | { |
| | | decimal temperatrue = (decimal)temperDevice.GetType().InvokeMember("currentTemperature", System.Reflection.BindingFlags.GetField, null, temperDevice, null); |
| | | if (temperatrue == 0) |
| | | { |
| | |
| | | if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | {
|
| | | { |
| | | decimal humidity = (decimal)humidDevice.GetType().InvokeMember("currentHumidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); |
| | | if (humidity == 0) |
| | | { |