diff --git a/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs b/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs index d3455a69..92a3e1ec 100644 --- a/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs +++ b/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs @@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Core.Crestron_IO InputPort = inputPort; + InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput); + InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange); } @@ -39,4 +41,10 @@ namespace PepperDash.Essentials.Core.Crestron_IO InputStateFeedback.FireUpdate(); } } + + public class GenericVersiportInputDeviceConfigProperties + { + + } + } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs b/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs index 0ef5bf24..570911f5 100644 --- a/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs +++ b/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs @@ -116,6 +116,15 @@ namespace PepperDash.Essentials.Devices.Common return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props); } + else if (typeName == "versiportinput") + { + var props = JsonConvert.DeserializeObject < PepperDash.Essentials.Core.Crestron_IO.GenericVersiportInputDeviceConfigProperties>(properties.ToString()); + + + //Versiport inputPort = new Versiport(); + //return new PepperDash.Essentials.Core.Crestron_IO.GenericVersiportInputDevice(inputPort); + } + else if (groupName == "settopbox") //(typeName == "irstbbase") { var irCont = IRPortHelper.GetIrOutputPortController(dc); diff --git a/Essentials Devices Common/Essentials Devices Common/Microphones/MicrophonePrivacyController.cs b/Essentials Devices Common/Essentials Devices Common/Microphones/MicrophonePrivacyController.cs index 0e8f365f..a8d4ea1b 100644 --- a/Essentials Devices Common/Essentials Devices Common/Microphones/MicrophonePrivacyController.cs +++ b/Essentials Devices Common/Essentials Devices Common/Microphones/MicrophonePrivacyController.cs @@ -11,13 +11,36 @@ using PepperDash.Essentials.Core.Crestron_IO; namespace PepperDash.Essentials.Devices.Common.Microphones { + /// + /// Used for applications where one or more microphones with momentary contact closure outputs are used to + /// toggle the privacy state of the room. Privacy state feedback is represented + /// public class MicrophonePrivacyController { + public bool EnableLeds + { + get + { + return _enableLeds; + } + set + { + if (value) + SetLedRelayStates(); + else + TurnOffAllLeds(); + _enableLeds = value; + } + } + bool _enableLeds; + public List Inputs { get; private set; } public GenericRelayDevice RedLedRelay { get; private set; } + bool _redLedRelayState; public GenericRelayDevice GreenLedRelay { get; private set; } + bool _greenLedRelayState; public IPrivacy PrivacyDevice { get; private set; } @@ -89,16 +112,42 @@ namespace PepperDash.Essentials.Devices.Common.Microphones void TurnOnRedLeds() { - GreenLedRelay.OpenRelay(); - RedLedRelay.CloseRelay(); + _greenLedRelayState = false; + _redLedRelayState = true; + SetLedRelayStates(); } void TurnOnGreenLeds() { - RedLedRelay.CloseRelay(); - GreenLedRelay.OpenRelay(); + _redLedRelayState = false; + _greenLedRelayState = true; + SetLedRelayStates(); } + /// + /// If enabled, sets the actual state of the relays + /// + void SetLedRelayStates() + { + if (_enableLeds) + { + if (_redLedRelayState) + RedLedRelay.CloseRelay(); + else + RedLedRelay.OpenRelay(); + + if (_greenLedRelayState) + GreenLedRelay.CloseRelay(); + else + GreenLedRelay.OpenRelay(); + } + else + TurnOffAllLeds(); + } + + /// + /// Turns off all LEDs + /// void TurnOffAllLeds() { GreenLedRelay.OpenRelay();