mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Updated GenericRelayControllerJoinMap and GenericRelayDevice
This commit is contained in:
parent
230f29d3f8
commit
adbb76b87c
2 changed files with 13 additions and 23 deletions
|
|
@ -70,16 +70,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||
#endregion
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new GenericRelayControllerJoinMap();
|
||||
{
|
||||
var joinMap = new GenericRelayControllerJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
if (RelayOutput == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to link device '{0}'. Relay is null", Key);
|
||||
|
|
@ -88,7 +86,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.Relay, b =>
|
||||
trilist.SetBoolSigAction(joinMap.Relay.JoinNumber, b =>
|
||||
{
|
||||
if (b)
|
||||
CloseRelay();
|
||||
|
|
@ -98,7 +96,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||
|
||||
// feedback for relay state
|
||||
|
||||
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay]);
|
||||
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue