From 4fb2d6d75576c376650f3a9a9873fcb070d3d5ae Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Wed, 5 Oct 2022 16:13:53 -0500 Subject: [PATCH 1/5] fix: updated XSig methods in VideoCodecBase --- .../Essentials Devices Common/VideoCodec/VideoCodecBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index 9fae1a99..b6fe5dcc 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1407,9 +1407,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec arrayIndex += offset; stringIndex += maxStrings; - digitalIndex++; + digitalIndex += maxDigitals; } - while (digitalIndex < maxCalls) + while (digitalIndex < maxCalls * offset) { //digitals tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false); @@ -1426,7 +1426,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec arrayIndex += offset; stringIndex += maxStrings; - digitalIndex++; + digitalIndex += maxDigitals; } return GetXSigString(tokenArray); From 62275890cb8648c33dd431be9598364405b025be Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Thu, 6 Oct 2022 00:38:02 -0500 Subject: [PATCH 2/5] style: changed tracking variable in UpdateCallStatusXsig --- .../Essentials Devices Common/VideoCodec/VideoCodecBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index b6fe5dcc..bea5862c 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1409,7 +1409,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec stringIndex += maxStrings; digitalIndex += maxDigitals; } - while (digitalIndex < maxCalls * offset) + while (arrayIndex < maxCalls * offset) { //digitals tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false); From 040c57b5e10abbe2b8b9ec1723d736bcba90fbdb Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 6 Oct 2022 10:05:44 -0600 Subject: [PATCH 3/5] fix(essentials): Updates to shade interfaces to clarify functionality --- .../EssentialsShadeDriver.cs | 8 ++--- .../Shades/Shade Interfaces.cs | 35 +++++++++++++------ .../Shades/ShadeBase.cs | 4 +-- .../Environment/Somfy/RelayControlledShade.cs | 4 +-- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs b/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs index b62e047c..fb40252c 100644 --- a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs +++ b/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs @@ -97,10 +97,10 @@ namespace PepperDash.Essentials { TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open); - TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).StopOrPreset); - - if(ShadeDevice is RelayControlledShade) - TriList.SetString(StringJoinBase + 2, (ShadeDevice as RelayControlledShade).StopOrPresetButtonLabel); + TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop); + + if (ShadeDevice is IShadesOpenCloseStop) + TriList.SetString(StringJoinBase + 2, "Stop"); TriList.SetSigFalseAction(ButtonPressJoinBase + 3, ShadeDevice.Close); } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs index 35492162..949009f6 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs @@ -19,6 +19,7 @@ namespace PepperDash.Essentials.Core.Shades /// /// Requirements for a device that implements basic Open/Close shade control /// + [Obsolete("Please use IShadesOpenCloseStop instead")] public interface IShadesOpenClose { void Open(); @@ -28,15 +29,26 @@ namespace PepperDash.Essentials.Core.Shades /// /// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays) /// - public interface IShadesOpenCloseStop : IShadesOpenClose - { - void StopOrPreset(); - string StopOrPresetButtonLabel { get; } + public interface IShadesOpenCloseStop + { + void Open(); + void Close(); + void Stop(); + } + + public interface IShadesOpenClosePreset : IShadesOpenCloseStop + { + void RecallPreset(uint presetNumber); + void SavePreset(uint presetNumber); + string StopOrPresetButtonLabel { get; } + + event EventHandler PresetSaved; } /// /// Requirements for a shade that implements press/hold raise/lower functions - /// + /// + [Obsolete("Please use IShadesOpenCloseStop instead")] public interface IShadesRaiseLower { void Raise(bool state); @@ -55,7 +67,7 @@ namespace PepperDash.Essentials.Core.Shades /// /// Requirements for a shade/scene that is open or closed /// - public interface IShadesOpenClosedFeedback: IShadesOpenClose + public interface IShadesOpenClosedFeedback: IShadesOpenCloseStop { BoolFeedback ShadeIsOpenFeedback { get; } BoolFeedback ShadeIsClosedFeedback { get; } @@ -63,15 +75,16 @@ namespace PepperDash.Essentials.Core.Shades /// /// - /// - public interface IShadesStop + /// + [Obsolete("Please use IShadesOpenCloseStop instead")] + public interface IShadesStop { void Stop(); } /// - /// - /// + /// Used to implement raise/stop/lower/stop from single button + /// public interface IShadesStopOrMove { void OpenOrStop(); @@ -82,7 +95,7 @@ namespace PepperDash.Essentials.Core.Shades /// /// Basic feedback for shades/scene stopped /// - public interface IShadesStopFeedback + public interface IShadesStopFeedback : IShadesOpenCloseStop { BoolFeedback IsStoppedFeedback { get; } } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs index d30b716a..2b92480e 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs @@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades /// /// Base class for a shade device /// - public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose + public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop { public ShadeBase(string key, string name) : base(key, name) @@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Core.Shades #region iShadesOpenClose Members public abstract void Open(); - public abstract void StopOrPreset(); + public abstract void Stop(); public abstract void Close(); #endregion diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs index a78e5045..852d554f 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs @@ -56,9 +56,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy PulseOutput(OpenRelay, RelayPulseTime); } - public override void StopOrPreset() + public override void Stop() { - Debug.Console(1, this, "Stopping or recalling preset on Shade: '{0}'", this.Name); + Debug.Console(1, this, "Stopping Shade: '{0}'", this.Name); PulseOutput(StopOrPresetRelay, RelayPulseTime); } From f3fc0f2b2626d604b970aefc32a05aa4fcf1c3ff Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Tue, 18 Oct 2022 10:51:24 -0500 Subject: [PATCH 4/5] fix: update xSig Method for active call status --- .../VideoCodec/VideoCodecBase.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index bea5862c..44d3f423 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold); //serials - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); - tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); + tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); + tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); + tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); + tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); + tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); if(call.Duration != null) { // May need to verify correct string format here @@ -1417,12 +1417,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec //serials - tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty); - tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty); - tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty); - tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty); - tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty); - tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty); + tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, String.Empty); + tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty); + tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty); + tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty); + tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty); + tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty); arrayIndex += offset; stringIndex += maxStrings; From 53596040987fcfb834e298bfc1ce72e7f539205c Mon Sep 17 00:00:00 2001 From: jdevito Date: Thu, 20 Oct 2022 11:11:07 -0500 Subject: [PATCH 5/5] fix: added bool property tracking if meeting is require, added poll method and updated GetBookings to reference bool property that prohibits polling when meeting password is required --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 30ec50c8..96d966f4 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -66,6 +66,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private readonly ZoomRoomPropertiesConfig _props; + private bool _meetingPasswordRequired; + + public void Poll(string pollString) + { + if(_meetingPasswordRequired) return; + + SendText(string.Format("{0}{1}", pollString, SendDelimiter)); + } + public ZoomRoom(DeviceConfig config, IBasicCommunication comm) : base(config) { @@ -79,13 +88,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (_props.CommunicationMonitorProperties != null) { - CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, - _props.CommunicationMonitorProperties); + CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError, + () => Poll(_props.CommunicationMonitorProperties.PollString)); } else { - CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, - "zStatus SystemUnit" + SendDelimiter); + CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit")); } DeviceManager.AddDevice(CommunicationMonitor); @@ -1985,6 +1993,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /// private void GetBookings() { + if (_meetingPasswordRequired) return; + SendText("zCommand Bookings List"); } @@ -2170,6 +2180,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom ); } + _meetingPasswordRequired = false; base.OnCallStatusChange(item); Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}", @@ -3390,6 +3401,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var handler = PasswordRequired; if (handler != null) { + if(!loginFailed || !loginCancelled) + _meetingPasswordRequired = true; + handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message)); } }