mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Merge pull request #307 from PepperDash/hotfix/bridge-registration
Update EISC Registration to happen AFTER devices are linked
This commit is contained in:
@@ -27,8 +27,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
|
|
||||||
Eisc.Register();
|
|
||||||
|
|
||||||
AddPostActivationAction(() =>
|
AddPostActivationAction(() =>
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Linking Devices...");
|
Debug.Console(1, this, "Linking Devices...");
|
||||||
@@ -77,6 +75,15 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
}
|
}
|
||||||
Debug.Console(1, this, "Devices Linked.");
|
Debug.Console(1, this, "Devices Linked.");
|
||||||
|
|
||||||
|
var registerResult = Eisc.Register();
|
||||||
|
|
||||||
|
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
|
|
||||||
Eisc.Register();
|
|
||||||
|
|
||||||
AddPostActivationAction( () =>
|
AddPostActivationAction( () =>
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Linking Devices...");
|
Debug.Console(1, this, "Linking Devices...");
|
||||||
@@ -121,6 +119,16 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
var bridge = device as IBridgeAdvanced;
|
var bridge = device as IBridgeAdvanced;
|
||||||
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var registerResult = Eisc.Register();
|
||||||
|
|
||||||
|
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user