add config object to stop downloading large phonebooks

This commit is contained in:
Andrew Welker
2020-09-30 13:55:40 -06:00
parent 4b9d7d1a1f
commit e365944dc3
2 changed files with 12 additions and 4 deletions

View File

@@ -39,10 +39,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private int _previousVolumeLevel; private int _previousVolumeLevel;
private CameraBase _selectedCamera; private CameraBase _selectedCamera;
private readonly ZoomRoomPropertiesConfig _props;
public ZoomRoom(DeviceConfig config, IBasicCommunication comm) public ZoomRoom(DeviceConfig config, IBasicCommunication comm)
: base(config) : base(config)
{ {
var props = JsonConvert.DeserializeObject<ZoomRoomPropertiesConfig>(config.Properties.ToString()); _props = JsonConvert.DeserializeObject<ZoomRoomPropertiesConfig>(config.Properties.ToString());
// The queue that will collect the repsonses in the order they are received // The queue that will collect the repsonses in the order they are received
_receiveQueue = new CrestronQueue<string>(1024); _receiveQueue = new CrestronQueue<string>(1024);
@@ -52,10 +54,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Communication = comm; Communication = comm;
if (props.CommunicationMonitorProperties != null) if (_props.CommunicationMonitorProperties != null)
{ {
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
props.CommunicationMonitorProperties); _props.CommunicationMonitorProperties);
} }
else else
{ {
@@ -625,7 +627,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
// zCommand // zCommand
_syncState.AddQueryToQueue("zCommand Phonebook List Offset: 0 Limit: 512"); if (!_props.DisablePhonebookAutoDownload)
{
_syncState.AddQueryToQueue("zCommand Phonebook List Offset: 0 Limit: 512");
}
_syncState.AddQueryToQueue("zCommand Bookings List"); _syncState.AddQueryToQueue("zCommand Bookings List");

View File

@@ -12,5 +12,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoomPropertiesConfig public class ZoomRoomPropertiesConfig
{ {
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public bool DisablePhonebookAutoDownload { get; set; }
} }
} }