| | |
| | | |
| | | public override void RemoveFromParent()
|
| | | {
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice" + room.Id);
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice" + room.Id);
|
| | | base.RemoveFromParent();
|
| | | } |
| | | |
| | |
| | | |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, (Action<ZigBee.Device.CommonDevice>)((report) => |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice" + room.Id); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice" + room.Id, ReceiveComandDiv.A设备属性上报, (report) => |
| | | { |
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); |
| | | if (room.TemperatrueDevice != mainKeys) |
| | |
| | | } |
| | | } |
| | | } |
| | | })); |
| | | }); |
| | | //发送获取温度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | if (dev != null) |
| | |
| | | |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) => |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"+room.Id); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice" + room.Id, ReceiveComandDiv.A设备属性上报, (report) => |
| | | { |
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); |
| | | if (room.HumidityDevice != mainKeys) |