diff --git a/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs b/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs index 4e9c1462..1af64eda 100644 --- a/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs +++ b/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs @@ -19,6 +19,8 @@ namespace PepperDash.Essentials.Devices.Common.Microphones { MicrophonePrivacyControllerConfig Config; + bool initialized; + public bool EnableLeds { get @@ -29,13 +31,16 @@ namespace PepperDash.Essentials.Devices.Common.Microphones { _enableLeds = value; - if (value) + if (initialized) { - CheckPrivacyMode(); - SetLedStates(); + if (value) + { + CheckPrivacyMode(); + SetLedStates(); + } + else + TurnOffAllLeds(); } - else - TurnOffAllLeds(); } } bool _enableLeds; @@ -84,6 +89,8 @@ namespace PepperDash.Essentials.Devices.Common.Microphones CheckPrivacyMode(); + initialized = true; + return base.CustomActivate(); } diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index f21ccd59..14bca03f 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -50,7 +50,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec { get { - var value = ActiveCalls.Any(c => c.IsActiveCall); + bool value; + + if (ActiveCalls != null) + value = ActiveCalls.Any(c => c.IsActiveCall); + else + value = false; return value; } } diff --git a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index fe7c4d9c..f6a2b456 100644 --- a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -112,16 +112,39 @@ namespace PepperDash.Essentials.Room.Config { mP.SetPrivacyDevice(room); - // Tie LED enable to room power state - room.OnFeedback.OutputChange += (o, a) => - { - if (room.OnFeedback.BoolValue) - mP.EnableLeds = true; - else - mP.EnableLeds = false; - }; + var behaviour = props.MicrophonePrivacy.Behaviour.ToLower(); - mP.EnableLeds = room.OnFeedback.BoolValue; + if (behaviour != null) + { + if (behaviour == "trackroomstate") + { + // Tie LED enable to room power state + room.OnFeedback.OutputChange += (o, a) => + { + if (room.OnFeedback.BoolValue) + mP.EnableLeds = true; + else + mP.EnableLeds = false; + }; + + mP.EnableLeds = room.OnFeedback.BoolValue; + } + else if (behaviour == "trackcallstate") + { + // Tie LED enable to room power state + room.InCallFeedback.OutputChange += (o, a) => + { + if (room.InCallFeedback.BoolValue) + mP.EnableLeds = true; + else + mP.EnableLeds = false; + }; + + mP.EnableLeds = room.InCallFeedback.BoolValue; + } + } + else + Debug.Console(0, "No behaviour defined for MicrophonePrivacyController"); return mP; } @@ -153,6 +176,7 @@ namespace PepperDash.Essentials.Room.Config public class EssentialsRoomMicrophonePrivacyConfig { public string DeviceKey { get; set; } + public string Behaviour { get; set; } } /// diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 89c5b022..5cbec0ca 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index 9b672414..7e62e128 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ