mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 19:34:51 +00:00
Merge pull request #321 from PepperDash/bugfix/RemotePreactivation
Fixed issue where a remote would not run its preactivation action …
This commit is contained in:
@@ -22,6 +22,7 @@ namespace PepperDash.Essentials.Core
|
||||
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback
|
||||
{
|
||||
private CenRfgwController _gateway;
|
||||
private GatewayBase _gatewayBase;
|
||||
|
||||
private Hr1x0WirelessRemoteBase _remote;
|
||||
|
||||
@@ -43,27 +44,31 @@ namespace PepperDash.Essentials.Core
|
||||
var rfId = (uint)props.Control.InfinetIdInt;
|
||||
_config = config;
|
||||
|
||||
GatewayBase gateway;
|
||||
|
||||
if (props.GatewayDeviceKey == "processor")
|
||||
{
|
||||
gateway = Global.ControlSystem.ControllerRFGatewayDevice;
|
||||
{
|
||||
AddPreActivationAction(() =>
|
||||
{
|
||||
_remote = preActivationFunc(config);
|
||||
RegisterEvents();
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
var gatewayDev = DeviceManager.GetDeviceForKey(props.GatewayDeviceKey) as CenRfgwController;
|
||||
if (gatewayDev == null)
|
||||
{
|
||||
var gatewayDev = DeviceManager.GetDeviceForKey(props.GatewayDeviceKey) as CenRfgwController;
|
||||
if (gatewayDev == null)
|
||||
{
|
||||
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is not a valid device", props.GatewayDeviceKey);
|
||||
}
|
||||
if (gatewayDev != null)
|
||||
{
|
||||
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is a valid device", props.GatewayDeviceKey);
|
||||
gateway = gatewayDev.GateWay;
|
||||
_gateway = gatewayDev;
|
||||
}
|
||||
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is not a valid device", props.GatewayDeviceKey);
|
||||
}
|
||||
if (gatewayDev != null)
|
||||
{
|
||||
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is a valid device", props.GatewayDeviceKey);
|
||||
_gateway = gatewayDev;
|
||||
}
|
||||
|
||||
|
||||
if (_gateway == null) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user