ECS-838 Add method to set lighting integrationID from Bridge.

This commit is contained in:
Jason T Alborough
2018-09-14 16:55:22 -04:00
parent 7b4aad3516
commit 4a69207038
2 changed files with 8 additions and 1 deletions

View File

@@ -66,11 +66,16 @@ namespace PepperDash.Essentials
{ {
comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]); comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
} }
var lutronLights = Lights as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => Lights.SelectScene(Lights.LightingScenes[u])); ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => Lights.SelectScene(Lights.LightingScenes[u]));
ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
int sceneIndex = 1; int sceneIndex = 1;
foreach (var scene in Lights.LightingScenes) foreach (var scene in Lights.LightingScenes)
{ {
var tempIndex = sceneIndex - 1; var tempIndex = sceneIndex - 1;
ApiEisc.Eisc.SetSigTrueAction((uint)(ApiMap.LightingSceneOffset + sceneIndex), () => Lights.SelectScene(Lights.LightingScenes[tempIndex])); ApiEisc.Eisc.SetSigTrueAction((uint)(ApiMap.LightingSceneOffset + sceneIndex), () => Lights.SelectScene(Lights.LightingScenes[tempIndex]));
scene.IsActiveFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[(uint)(ApiMap.LightingSceneOffset + sceneIndex)]); scene.IsActiveFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[(uint)(ApiMap.LightingSceneOffset + sceneIndex)]);
ApiEisc.Eisc.StringInput[(uint)(ApiMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name; ApiEisc.Eisc.StringInput[(uint)(ApiMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
@@ -108,6 +113,8 @@ namespace PepperDash.Essentials
public ushort LightingSceneOffset = 10; public ushort LightingSceneOffset = 10;
public ushort ButtonVisibilityOffset = 40; public ushort ButtonVisibilityOffset = 40;
public ushort CallPreset = 1; public ushort CallPreset = 1;
public ushort integrationID = 1;
public EssentialsLightsBridgeApiMap() public EssentialsLightsBridgeApiMap()
{ {