From 53596040987fcfb834e298bfc1ce72e7f539205c Mon Sep 17 00:00:00 2001 From: jdevito Date: Thu, 20 Oct 2022 11:11:07 -0500 Subject: [PATCH] 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)); } }