mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +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
|
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback
|
||||||
{
|
{
|
||||||
private CenRfgwController _gateway;
|
private CenRfgwController _gateway;
|
||||||
|
private GatewayBase _gatewayBase;
|
||||||
|
|
||||||
private Hr1x0WirelessRemoteBase _remote;
|
private Hr1x0WirelessRemoteBase _remote;
|
||||||
|
|
||||||
@@ -43,15 +44,20 @@ namespace PepperDash.Essentials.Core
|
|||||||
var rfId = (uint)props.Control.InfinetIdInt;
|
var rfId = (uint)props.Control.InfinetIdInt;
|
||||||
_config = config;
|
_config = config;
|
||||||
|
|
||||||
GatewayBase gateway;
|
|
||||||
|
|
||||||
if (props.GatewayDeviceKey == "processor")
|
if (props.GatewayDeviceKey == "processor")
|
||||||
{
|
{
|
||||||
gateway = Global.ControlSystem.ControllerRFGatewayDevice;
|
{
|
||||||
|
AddPreActivationAction(() =>
|
||||||
|
{
|
||||||
|
_remote = preActivationFunc(config);
|
||||||
|
RegisterEvents();
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var gatewayDev = DeviceManager.GetDeviceForKey(props.GatewayDeviceKey) as CenRfgwController;
|
var gatewayDev = DeviceManager.GetDeviceForKey(props.GatewayDeviceKey) as CenRfgwController;
|
||||||
if (gatewayDev == null)
|
if (gatewayDev == null)
|
||||||
{
|
{
|
||||||
@@ -60,10 +66,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
if (gatewayDev != null)
|
if (gatewayDev != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is a valid device", props.GatewayDeviceKey);
|
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is a valid device", props.GatewayDeviceKey);
|
||||||
gateway = gatewayDev.GateWay;
|
|
||||||
_gateway = gatewayDev;
|
_gateway = gatewayDev;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (_gateway == null) return;
|
if (_gateway == null) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user