From 1257dde4ce3d90545add7ee6db0992d5278e677a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 16 Sep 2019 16:36:24 -0600 Subject: [PATCH] Continued work on bridge --- .../GlsOccupancySensorBaseControllerBridge.cs | 19 +++++++++++++++++++ .../GlsOccupancySensorBaseController.cs | 8 ++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs b/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs index d1eecf09..3beffbb5 100644 --- a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs +++ b/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Crestron.SimplSharp; +using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Essentials.Devices.Common.Occupancy; @@ -29,6 +30,24 @@ namespace PepperDash.Essentials.Bridges Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); + trilist.SetSigTrueAction(joinMap.ForceOccupied, () => occController.ForceOccupied()); + trilist.SetSigTrueAction(joinMap.ForceVacant, () => occController.ForceVacant()); + occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]); + occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]); + occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]); + + trilist.SetUShortSigAction(joinMap.Timeout, (u) => occController.SetRemoteTimeout(u)); + occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]); + occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]); + + trilist.SetSigTrueAction(joinMap.EnableLedFlash, () => occController.SetLedFlashEnable(true)); + trilist.SetSigTrueAction(joinMap.DisableLedFlash, () => occController.SetLedFlashEnable(false)); + occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]); + + trilist.SetSigTrueAction(joinMap.EnableShortTimeout, () => occController.SetShortTimeoutState(true)); + trilist.SetSigTrueAction(joinMap.DisableShortTimeout, () => occController.SetShortTimeoutState(false)); + occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]); + } } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs index 1c6a2281..a735d9a8 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs @@ -222,14 +222,14 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy OccSensor.DecrementPirSensitivityInVacantState.BoolValue = pressRelease; } - public void ForceOccupied(bool state) + public void ForceOccupied() { - OccSensor.ForceOccupied.BoolValue = state; + OccSensor.ForceOccupied.BoolValue = true; } - public void ForceVacant(bool state) + public void ForceVacant() { - OccSensor.ForceVacant.BoolValue = state; + OccSensor.ForceVacant.BoolValue = true; } public void EnableRawStates(bool state)