mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
chore: move all files to file-scoped namespace
This commit is contained in:
parent
aaa5b0532b
commit
3ece4f0b7b
522 changed files with 39628 additions and 45678 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -8,491 +8,481 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a device that manages room combinations by controlling partitions and scenarios.
|
||||
/// </summary>
|
||||
/// <remarks>The <see cref="EssentialsRoomCombiner"/> allows for dynamic configuration of room
|
||||
/// combinations based on partition states and predefined scenarios. It supports both automatic and manual modes
|
||||
/// for managing room combinations. In automatic mode, the device determines the current room combination scenario
|
||||
/// based on partition sensor states. In manual mode, scenarios can be set explicitly by the user.</remarks>
|
||||
public class EssentialsRoomCombiner : EssentialsDevice, IEssentialsRoomCombiner
|
||||
{
|
||||
private EssentialsRoomCombinerPropertiesConfig _propertiesConfig;
|
||||
|
||||
private IRoomCombinationScenario _currentScenario;
|
||||
|
||||
private List<IEssentialsRoom> _rooms;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a device that manages room combinations by controlling partitions and scenarios.
|
||||
/// Gets a list of rooms represented as key-name pairs.
|
||||
/// </summary>
|
||||
/// <remarks>The <see cref="EssentialsRoomCombiner"/> allows for dynamic configuration of room
|
||||
/// combinations based on partition states and predefined scenarios. It supports both automatic and manual modes
|
||||
/// for managing room combinations. In automatic mode, the device determines the current room combination scenario
|
||||
/// based on partition sensor states. In manual mode, scenarios can be set explicitly by the user.</remarks>
|
||||
public class EssentialsRoomCombiner : EssentialsDevice, IEssentialsRoomCombiner
|
||||
public List<IKeyName> Rooms
|
||||
{
|
||||
private EssentialsRoomCombinerPropertiesConfig _propertiesConfig;
|
||||
|
||||
private IRoomCombinationScenario _currentScenario;
|
||||
|
||||
private List<IEssentialsRoom> _rooms;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of rooms represented as key-name pairs.
|
||||
/// </summary>
|
||||
public List<IKeyName> Rooms
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return _rooms.Cast<IKeyName>().ToList();
|
||||
}
|
||||
return _rooms.Cast<IKeyName>().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isInAutoMode;
|
||||
private bool _isInAutoMode;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the system is operating in automatic mode.
|
||||
/// </summary>
|
||||
/// <remarks>Changing this property triggers an update event via
|
||||
/// <c>IsInAutoModeFeedback.FireUpdate()</c>. Ensure that any event listeners are properly configured to handle
|
||||
/// this update.</remarks>
|
||||
public bool IsInAutoMode
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the system is operating in automatic mode.
|
||||
/// </summary>
|
||||
/// <remarks>Changing this property triggers an update event via
|
||||
/// <c>IsInAutoModeFeedback.FireUpdate()</c>. Ensure that any event listeners are properly configured to handle
|
||||
/// this update.</remarks>
|
||||
public bool IsInAutoMode
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isInAutoMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _isInAutoMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isInAutoMode = value;
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
}
|
||||
return _isInAutoMode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether automatic mode is disabled.
|
||||
/// </summary>
|
||||
public bool DisableAutoMode
|
||||
set
|
||||
{
|
||||
get
|
||||
if (value == _isInAutoMode)
|
||||
{
|
||||
return _propertiesConfig.DisableAutoMode;
|
||||
}
|
||||
}
|
||||
|
||||
private CTimer _scenarioChangeDebounceTimer;
|
||||
|
||||
private int _scenarioChangeDebounceTimeSeconds = 10; // default to 10s
|
||||
|
||||
private Mutex _scenarioChange = new Mutex();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EssentialsRoomCombiner"/> class, which manages room combination
|
||||
/// scenarios and partition states.
|
||||
/// </summary>
|
||||
/// <remarks>The <see cref="EssentialsRoomCombiner"/> class is designed to handle dynamic room
|
||||
/// combination scenarios based on partition states. It supports both automatic and manual modes for managing
|
||||
/// room combinations. By default, the instance starts in automatic mode unless the <paramref name="props"/>
|
||||
/// specifies otherwise. After activation, the room combiner initializes partition state providers and sets up
|
||||
/// the initial room configuration. Additionally, it subscribes to the <see
|
||||
/// cref="DeviceManager.AllDevicesInitialized"/> event to ensure proper initialization of dependent devices
|
||||
/// before determining or setting the room combination scenario.</remarks>
|
||||
/// <param name="key">The unique identifier for the room combiner instance.</param>
|
||||
/// <param name="props">The configuration properties for the room combiner, including default settings and debounce times.</param>
|
||||
public EssentialsRoomCombiner(string key, EssentialsRoomCombinerPropertiesConfig props)
|
||||
: base(key)
|
||||
{
|
||||
_propertiesConfig = props;
|
||||
|
||||
Partitions = new List<IPartitionController>();
|
||||
RoomCombinationScenarios = new List<IRoomCombinationScenario>();
|
||||
|
||||
if (_propertiesConfig.ScenarioChangeDebounceTimeSeconds > 0)
|
||||
{
|
||||
_scenarioChangeDebounceTimeSeconds = _propertiesConfig.ScenarioChangeDebounceTimeSeconds;
|
||||
}
|
||||
|
||||
IsInAutoModeFeedback = new BoolFeedback(() => _isInAutoMode);
|
||||
|
||||
// default to auto mode
|
||||
IsInAutoMode = true;
|
||||
|
||||
if (_propertiesConfig.defaultToManualMode)
|
||||
{
|
||||
IsInAutoMode = false;
|
||||
}
|
||||
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
|
||||
CreateScenarios();
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
SetupPartitionStateProviders();
|
||||
|
||||
SetRooms();
|
||||
});
|
||||
|
||||
|
||||
// Subscribe to the AllDevicesInitialized event
|
||||
// We need to wait until all devices are initialized in case
|
||||
// any actions are dependent on 3rd party devices already being
|
||||
// connected and initialized
|
||||
DeviceManager.AllDevicesInitialized += (o, a) =>
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
DetermineRoomCombinationScenario();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRoomCombinationScenario(_propertiesConfig.defaultScenarioKey);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateScenarios()
|
||||
{
|
||||
foreach (var scenarioConfig in _propertiesConfig.Scenarios)
|
||||
{
|
||||
var scenario = new RoomCombinationScenario(scenarioConfig);
|
||||
RoomCombinationScenarios.Add(scenario);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRooms()
|
||||
{
|
||||
_rooms = new List<IEssentialsRoom>();
|
||||
|
||||
foreach (var roomKey in _propertiesConfig.RoomKeys)
|
||||
{
|
||||
var room = DeviceManager.GetDeviceForKey(roomKey);
|
||||
|
||||
if (DeviceManager.GetDeviceForKey(roomKey) is IEssentialsRoom essentialsRoom)
|
||||
{
|
||||
_rooms.Add(essentialsRoom);
|
||||
}
|
||||
}
|
||||
|
||||
var rooms = DeviceManager.AllDevices.OfType<IEssentialsRoom>().Cast<Device>();
|
||||
|
||||
foreach (var room in rooms)
|
||||
{
|
||||
room.Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupPartitionStateProviders()
|
||||
{
|
||||
foreach (var pConfig in _propertiesConfig.Partitions)
|
||||
{
|
||||
var sensor = DeviceManager.GetDeviceForKey(pConfig.DeviceKey) as IPartitionStateProvider;
|
||||
|
||||
var partition = new EssentialsPartitionController(pConfig.Key, pConfig.Name, sensor, _propertiesConfig.defaultToManualMode, pConfig.AdjacentRoomKeys);
|
||||
|
||||
partition.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
|
||||
Partitions.Add(partition);
|
||||
}
|
||||
}
|
||||
|
||||
private void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
StartDebounceTimer();
|
||||
}
|
||||
|
||||
private void StartDebounceTimer()
|
||||
{
|
||||
// default to 500ms for manual mode
|
||||
var time = 500;
|
||||
|
||||
// if in auto mode, debounce the scenario change
|
||||
if (IsInAutoMode) time = _scenarioChangeDebounceTimeSeconds * 1000;
|
||||
|
||||
if (_scenarioChangeDebounceTimer == null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer = new CTimer((o) => DetermineRoomCombinationScenario(), time);
|
||||
}
|
||||
else
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Reset(time);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the current room combination scenario based on the state of the partition sensors
|
||||
/// </summary>
|
||||
private void DetermineRoomCombinationScenario()
|
||||
{
|
||||
if (_scenarioChangeDebounceTimer != null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Dispose();
|
||||
_scenarioChangeDebounceTimer = null;
|
||||
}
|
||||
|
||||
this.LogInformation("Determining Combination Scenario");
|
||||
|
||||
var currentScenario = RoomCombinationScenarios.FirstOrDefault((s) =>
|
||||
{
|
||||
this.LogDebug("Checking scenario {scenarioKey}", s.Key);
|
||||
// iterate the partition states
|
||||
foreach (var partitionState in s.PartitionStates)
|
||||
{
|
||||
this.LogDebug("checking PartitionState {partitionStateKey}", partitionState.PartitionKey);
|
||||
// get the partition by key
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
|
||||
this.LogDebug("Expected State: {partitionPresent} Actual State: {partitionState}", partitionState.PartitionPresent, partition.PartitionPresentFeedback.BoolValue);
|
||||
|
||||
if (partition != null && partitionState.PartitionPresent != partition.PartitionPresentFeedback.BoolValue)
|
||||
{
|
||||
// the partition can't be found or the state doesn't match
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// if it hasn't returned false by now we have the matching scenario
|
||||
return true;
|
||||
});
|
||||
|
||||
if (currentScenario != null)
|
||||
{
|
||||
this.LogInformation("Found combination Scenario {scenarioKey}", currentScenario.Key);
|
||||
ChangeScenario(currentScenario);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ChangeScenario(IRoomCombinationScenario newScenario)
|
||||
{
|
||||
|
||||
|
||||
if (newScenario == _currentScenario)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Deactivate the old scenario first
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Deactivating scenario {currentScenario}", this, _currentScenario.Name);
|
||||
await _currentScenario.Deactivate();
|
||||
}
|
||||
|
||||
_currentScenario = newScenario;
|
||||
|
||||
// Activate the new scenario
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, $"Current Scenario: {_currentScenario.Name}", this);
|
||||
await _currentScenario.Activate();
|
||||
}
|
||||
|
||||
RoomCombinationScenarioChanged?.Invoke(this, new EventArgs());
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region IEssentialsRoomCombiner Members
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the room combination scenario changes.
|
||||
/// </summary>
|
||||
/// <remarks>This event is triggered whenever the configuration or state of the room combination
|
||||
/// changes. Subscribers can use this event to update their logic or UI based on the new scenario.</remarks>
|
||||
public event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current room combination scenario.
|
||||
/// </summary>
|
||||
public IRoomCombinationScenario CurrentScenario
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentScenario;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsInAutoModeFeedback
|
||||
/// </summary>
|
||||
public BoolFeedback IsInAutoModeFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables auto mode for the room combiner and its partitions, allowing automatic room combination scenarios to
|
||||
/// be determined.
|
||||
/// </summary>
|
||||
/// <remarks>Auto mode allows the room combiner to automatically adjust its configuration based on
|
||||
/// the state of its partitions. If auto mode is disabled in the configuration, this method logs a warning and
|
||||
/// does not enable auto mode.</remarks>
|
||||
public void SetAutoMode()
|
||||
{
|
||||
if(_propertiesConfig.DisableAutoMode)
|
||||
{
|
||||
this.LogWarning("Auto mode is disabled for this room combiner. Cannot set to auto mode.");
|
||||
return;
|
||||
}
|
||||
IsInAutoMode = true;
|
||||
|
||||
foreach (var partition in Partitions)
|
||||
{
|
||||
partition.SetAutoMode();
|
||||
}
|
||||
_isInAutoMode = value;
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
DetermineRoomCombinationScenario();
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether automatic mode is disabled.
|
||||
/// </summary>
|
||||
public bool DisableAutoMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return _propertiesConfig.DisableAutoMode;
|
||||
}
|
||||
}
|
||||
|
||||
private CTimer _scenarioChangeDebounceTimer;
|
||||
|
||||
private int _scenarioChangeDebounceTimeSeconds = 10; // default to 10s
|
||||
|
||||
private Mutex _scenarioChange = new Mutex();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EssentialsRoomCombiner"/> class, which manages room combination
|
||||
/// scenarios and partition states.
|
||||
/// </summary>
|
||||
/// <remarks>The <see cref="EssentialsRoomCombiner"/> class is designed to handle dynamic room
|
||||
/// combination scenarios based on partition states. It supports both automatic and manual modes for managing
|
||||
/// room combinations. By default, the instance starts in automatic mode unless the <paramref name="props"/>
|
||||
/// specifies otherwise. After activation, the room combiner initializes partition state providers and sets up
|
||||
/// the initial room configuration. Additionally, it subscribes to the <see
|
||||
/// cref="DeviceManager.AllDevicesInitialized"/> event to ensure proper initialization of dependent devices
|
||||
/// before determining or setting the room combination scenario.</remarks>
|
||||
/// <param name="key">The unique identifier for the room combiner instance.</param>
|
||||
/// <param name="props">The configuration properties for the room combiner, including default settings and debounce times.</param>
|
||||
public EssentialsRoomCombiner(string key, EssentialsRoomCombinerPropertiesConfig props)
|
||||
: base(key)
|
||||
{
|
||||
_propertiesConfig = props;
|
||||
|
||||
Partitions = new List<IPartitionController>();
|
||||
RoomCombinationScenarios = new List<IRoomCombinationScenario>();
|
||||
|
||||
if (_propertiesConfig.ScenarioChangeDebounceTimeSeconds > 0)
|
||||
{
|
||||
_scenarioChangeDebounceTimeSeconds = _propertiesConfig.ScenarioChangeDebounceTimeSeconds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches the system to manual mode, disabling automatic operations.
|
||||
/// </summary>
|
||||
/// <remarks>This method sets the system to manual mode by updating the mode state and propagates
|
||||
/// the change to all partitions. Once in manual mode, automatic operations are disabled for the system and its
|
||||
/// partitions.</remarks>
|
||||
/// <summary>
|
||||
/// SetManualMode method
|
||||
/// </summary>
|
||||
public void SetManualMode()
|
||||
IsInAutoModeFeedback = new BoolFeedback(() => _isInAutoMode);
|
||||
|
||||
// default to auto mode
|
||||
IsInAutoMode = true;
|
||||
|
||||
if (_propertiesConfig.defaultToManualMode)
|
||||
{
|
||||
IsInAutoMode = false;
|
||||
|
||||
foreach (var partition in Partitions)
|
||||
{
|
||||
partition.SetManualMode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the current mode between automatic and manual.
|
||||
/// </summary>
|
||||
/// <remarks>If the current mode is automatic, this method switches to manual mode. If the
|
||||
/// current mode is manual, it switches to automatic mode.</remarks>
|
||||
/// <summary>
|
||||
/// ToggleMode method
|
||||
/// </summary>
|
||||
public void ToggleMode()
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
|
||||
CreateScenarios();
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
SetupPartitionStateProviders();
|
||||
|
||||
SetRooms();
|
||||
});
|
||||
|
||||
|
||||
// Subscribe to the AllDevicesInitialized event
|
||||
// We need to wait until all devices are initialized in case
|
||||
// any actions are dependent on 3rd party devices already being
|
||||
// connected and initialized
|
||||
DeviceManager.AllDevicesInitialized += (o, a) =>
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
SetManualMode();
|
||||
DetermineRoomCombinationScenario();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAutoMode();
|
||||
SetRoomCombinationScenario(_propertiesConfig.defaultScenarioKey);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateScenarios()
|
||||
{
|
||||
foreach (var scenarioConfig in _propertiesConfig.Scenarios)
|
||||
{
|
||||
var scenario = new RoomCombinationScenario(scenarioConfig);
|
||||
RoomCombinationScenarios.Add(scenario);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRooms()
|
||||
{
|
||||
_rooms = new List<IEssentialsRoom>();
|
||||
|
||||
foreach (var roomKey in _propertiesConfig.RoomKeys)
|
||||
{
|
||||
var room = DeviceManager.GetDeviceForKey(roomKey);
|
||||
|
||||
if (DeviceManager.GetDeviceForKey(roomKey) is IEssentialsRoom essentialsRoom)
|
||||
{
|
||||
_rooms.Add(essentialsRoom);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomCombinationScenarios
|
||||
/// </summary>
|
||||
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }
|
||||
var rooms = DeviceManager.AllDevices.OfType<IEssentialsRoom>().Cast<Device>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of partition controllers managed by this instance.
|
||||
/// </summary>
|
||||
public List<IPartitionController> Partitions { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the state of the partition identified by the specified partition key.
|
||||
/// </summary>
|
||||
/// <remarks>If no partition with the specified key exists, the method performs no
|
||||
/// action.</remarks>
|
||||
/// <param name="partitionKey">The key of the partition whose state is to be toggled. This value cannot be null or empty.</param>
|
||||
public void TogglePartitionState(string partitionKey)
|
||||
foreach (var room in rooms)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionKey));
|
||||
room.Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
if (partition != null)
|
||||
{
|
||||
partition.ToggglePartitionState();
|
||||
}
|
||||
private void SetupPartitionStateProviders()
|
||||
{
|
||||
foreach (var pConfig in _propertiesConfig.Partitions)
|
||||
{
|
||||
var sensor = DeviceManager.GetDeviceForKey(pConfig.DeviceKey) as IPartitionStateProvider;
|
||||
|
||||
var partition = new EssentialsPartitionController(pConfig.Key, pConfig.Name, sensor, _propertiesConfig.defaultToManualMode, pConfig.AdjacentRoomKeys);
|
||||
|
||||
partition.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
|
||||
Partitions.Add(partition);
|
||||
}
|
||||
}
|
||||
|
||||
private void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
StartDebounceTimer();
|
||||
}
|
||||
|
||||
private void StartDebounceTimer()
|
||||
{
|
||||
// default to 500ms for manual mode
|
||||
var time = 500;
|
||||
|
||||
// if in auto mode, debounce the scenario change
|
||||
if (IsInAutoMode) time = _scenarioChangeDebounceTimeSeconds * 1000;
|
||||
|
||||
if (_scenarioChangeDebounceTimer == null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer = new CTimer((o) => DetermineRoomCombinationScenario(), time);
|
||||
}
|
||||
else
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Reset(time);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the current room combination scenario based on the state of the partition sensors
|
||||
/// </summary>
|
||||
private void DetermineRoomCombinationScenario()
|
||||
{
|
||||
if (_scenarioChangeDebounceTimer != null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Dispose();
|
||||
_scenarioChangeDebounceTimer = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the room combination scenario based on the specified scenario key.
|
||||
/// </summary>
|
||||
/// <remarks>This method manually adjusts the partition states according to the specified
|
||||
/// scenario. If the application is in auto mode, the operation will not proceed, and a log message will be
|
||||
/// generated indicating that the mode must be set to manual first. If the specified scenario key does not
|
||||
/// match any existing scenario, a debug log message will be generated. For each partition state in the
|
||||
/// scenario, the corresponding partition will be updated to either "Present" or "Not Present" based on the
|
||||
/// scenario's configuration. If a partition key in the scenario cannot be found, a debug log message will be
|
||||
/// generated.</remarks>
|
||||
/// <param name="scenarioKey">The key identifying the room combination scenario to apply. This must match the key of an existing scenario.</param>
|
||||
public void SetRoomCombinationScenario(string scenarioKey)
|
||||
this.LogInformation("Determining Combination Scenario");
|
||||
|
||||
var currentScenario = RoomCombinationScenarios.FirstOrDefault((s) =>
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
this.LogDebug("Checking scenario {scenarioKey}", s.Key);
|
||||
// iterate the partition states
|
||||
foreach (var partitionState in s.PartitionStates)
|
||||
{
|
||||
this.LogDebug("checking PartitionState {partitionStateKey}", partitionState.PartitionKey);
|
||||
// get the partition by key
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
|
||||
this.LogDebug("Expected State: {partitionPresent} Actual State: {partitionState}", partitionState.PartitionPresent, partition.PartitionPresentFeedback.BoolValue);
|
||||
|
||||
if (partition != null && partitionState.PartitionPresent != partition.PartitionPresentFeedback.BoolValue)
|
||||
{
|
||||
// the partition can't be found or the state doesn't match
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// if it hasn't returned false by now we have the matching scenario
|
||||
return true;
|
||||
});
|
||||
|
||||
if (currentScenario != null)
|
||||
{
|
||||
this.LogInformation("Found combination Scenario {scenarioKey}", currentScenario.Key);
|
||||
ChangeScenario(currentScenario);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ChangeScenario(IRoomCombinationScenario newScenario)
|
||||
{
|
||||
|
||||
|
||||
if (newScenario == _currentScenario)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Cannot set room combination scenario when in auto mode. Set to auto mode first.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the scenario
|
||||
var scenario = RoomCombinationScenarios.FirstOrDefault((s) => s.Key.Equals(scenarioKey));
|
||||
|
||||
|
||||
// Set the parition states from the scenario manually
|
||||
if (scenario != null)
|
||||
// Deactivate the old scenario first
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting scenario to '{0}'", scenario.Key);
|
||||
foreach (var partitionState in scenario.PartitionStates)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
Debug.LogMessage(LogEventLevel.Information, "Deactivating scenario {currentScenario}", this, _currentScenario.Name);
|
||||
await _currentScenario.Deactivate();
|
||||
}
|
||||
|
||||
if (partition != null)
|
||||
_currentScenario = newScenario;
|
||||
|
||||
// Activate the new scenario
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, $"Current Scenario: {_currentScenario.Name}", this);
|
||||
await _currentScenario.Activate();
|
||||
}
|
||||
|
||||
RoomCombinationScenarioChanged?.Invoke(this, new EventArgs());
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region IEssentialsRoomCombiner Members
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the room combination scenario changes.
|
||||
/// </summary>
|
||||
/// <remarks>This event is triggered whenever the configuration or state of the room combination
|
||||
/// changes. Subscribers can use this event to update their logic or UI based on the new scenario.</remarks>
|
||||
public event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current room combination scenario.
|
||||
/// </summary>
|
||||
public IRoomCombinationScenario CurrentScenario
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentScenario;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the feedback indicating whether the system is currently in auto mode.
|
||||
/// </summary>
|
||||
public BoolFeedback IsInAutoModeFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables auto mode for the room combiner and its partitions, allowing automatic room combination scenarios to
|
||||
/// be determined.
|
||||
/// </summary>
|
||||
/// <remarks>Auto mode allows the room combiner to automatically adjust its configuration based on
|
||||
/// the state of its partitions. If auto mode is disabled in the configuration, this method logs a warning and
|
||||
/// does not enable auto mode.</remarks>
|
||||
public void SetAutoMode()
|
||||
{
|
||||
if(_propertiesConfig.DisableAutoMode)
|
||||
{
|
||||
this.LogWarning("Auto mode is disabled for this room combiner. Cannot set to auto mode.");
|
||||
return;
|
||||
}
|
||||
IsInAutoMode = true;
|
||||
|
||||
foreach (var partition in Partitions)
|
||||
{
|
||||
partition.SetAutoMode();
|
||||
}
|
||||
|
||||
DetermineRoomCombinationScenario();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches the system to manual mode, disabling automatic operations.
|
||||
/// </summary>
|
||||
/// <remarks>This method sets the system to manual mode by updating the mode state and propagates
|
||||
/// the change to all partitions. Once in manual mode, automatic operations are disabled for the system and its
|
||||
/// partitions.</remarks>
|
||||
public void SetManualMode()
|
||||
{
|
||||
IsInAutoMode = false;
|
||||
|
||||
foreach (var partition in Partitions)
|
||||
{
|
||||
partition.SetManualMode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the current mode between automatic and manual.
|
||||
/// </summary>
|
||||
/// <remarks>If the current mode is automatic, this method switches to manual mode. If the
|
||||
/// current mode is manual, it switches to automatic mode.</remarks>
|
||||
public void ToggleMode()
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
SetManualMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAutoMode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of room combination scenarios.
|
||||
/// </summary>
|
||||
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of partition controllers managed by this instance.
|
||||
/// </summary>
|
||||
public List<IPartitionController> Partitions { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the state of the partition identified by the specified partition key.
|
||||
/// </summary>
|
||||
/// <remarks>If no partition with the specified key exists, the method performs no
|
||||
/// action.</remarks>
|
||||
/// <param name="partitionKey">The key of the partition whose state is to be toggled. This value cannot be null or empty.</param>
|
||||
public void TogglePartitionState(string partitionKey)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionKey));
|
||||
|
||||
if (partition != null)
|
||||
{
|
||||
partition.ToggglePartitionState();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the room combination scenario based on the specified scenario key.
|
||||
/// </summary>
|
||||
/// <remarks>This method manually adjusts the partition states according to the specified
|
||||
/// scenario. If the application is in auto mode, the operation will not proceed, and a log message will be
|
||||
/// generated indicating that the mode must be set to manual first. If the specified scenario key does not
|
||||
/// match any existing scenario, a debug log message will be generated. For each partition state in the
|
||||
/// scenario, the corresponding partition will be updated to either "Present" or "Not Present" based on the
|
||||
/// scenario's configuration. If a partition key in the scenario cannot be found, a debug log message will be
|
||||
/// generated.</remarks>
|
||||
/// <param name="scenarioKey">The key identifying the room combination scenario to apply. This must match the key of an existing scenario.</param>
|
||||
public void SetRoomCombinationScenario(string scenarioKey)
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Cannot set room combination scenario when in auto mode. Set to auto mode first.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the scenario
|
||||
var scenario = RoomCombinationScenarios.FirstOrDefault((s) => s.Key.Equals(scenarioKey));
|
||||
|
||||
|
||||
// Set the parition states from the scenario manually
|
||||
if (scenario != null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting scenario to '{0}'", scenario.Key);
|
||||
foreach (var partitionState in scenario.PartitionStates)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
|
||||
if (partition != null)
|
||||
{
|
||||
if (partitionState.PartitionPresent)
|
||||
{
|
||||
if (partitionState.PartitionPresent)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting state to Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStatePresent();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting state to Not Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStateNotPresent();
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting state to Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStatePresent();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Manually setting state to Not Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStateNotPresent();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find scenario with key: '{0}'", scenarioKey);
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find scenario with key: '{0}'", scenarioKey);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory for creating instances of <see cref="EssentialsRoomCombiner"/> devices.
|
||||
/// </summary>
|
||||
/// <remarks>This factory is responsible for constructing <see cref="EssentialsRoomCombiner"/> devices
|
||||
/// based on the provided configuration. It supports the type name "essentialsroomcombiner" for device
|
||||
/// creation.</remarks>
|
||||
public class EssentialsRoomCombinerFactory : EssentialsDeviceFactory<EssentialsRoomCombiner>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EssentialsRoomCombinerFactory"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>This factory is used to create instances of room combiners with the specified type
|
||||
/// names. By default, the factory includes the type name "essentialsroomcombiner".</remarks>
|
||||
public EssentialsRoomCombinerFactory()
|
||||
{
|
||||
TypeNames = new List<string> { "essentialsroomcombiner" };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory for creating instances of <see cref="EssentialsRoomCombiner"/> devices.
|
||||
/// Creates and initializes a new instance of the <see cref="EssentialsRoomCombiner"/> device.
|
||||
/// </summary>
|
||||
/// <remarks>This factory is responsible for constructing <see cref="EssentialsRoomCombiner"/> devices
|
||||
/// based on the provided configuration. It supports the type name "essentialsroomcombiner" for device
|
||||
/// creation.</remarks>
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomCombinerFactory
|
||||
/// </summary>
|
||||
public class EssentialsRoomCombinerFactory : EssentialsDeviceFactory<EssentialsRoomCombiner>
|
||||
/// <remarks>This method uses the provided device configuration to extract the properties and
|
||||
/// create an <see cref="EssentialsRoomCombiner"/> device. Ensure that the configuration contains valid
|
||||
/// properties for the device to be created successfully.</remarks>
|
||||
/// <param name="dc">The device configuration containing the key and properties required to build the device.</param>
|
||||
/// <returns>A new instance of <see cref="EssentialsRoomCombiner"/> initialized with the specified configuration.</returns>
|
||||
public override EssentialsDevice BuildDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc)
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EssentialsRoomCombinerFactory"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>This factory is used to create instances of room combiners with the specified type
|
||||
/// names. By default, the factory includes the type name "essentialsroomcombiner".</remarks>
|
||||
public EssentialsRoomCombinerFactory()
|
||||
{
|
||||
TypeNames = new List<string> { "essentialsroomcombiner" };
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new EssentialsRoomCombiner Device");
|
||||
|
||||
/// <summary>
|
||||
/// Creates and initializes a new instance of the <see cref="EssentialsRoomCombiner"/> device.
|
||||
/// </summary>
|
||||
/// <remarks>This method uses the provided device configuration to extract the properties and
|
||||
/// create an <see cref="EssentialsRoomCombiner"/> device. Ensure that the configuration contains valid
|
||||
/// properties for the device to be created successfully.</remarks>
|
||||
/// <param name="dc">The device configuration containing the key and properties required to build the device.</param>
|
||||
/// <returns>A new instance of <see cref="EssentialsRoomCombiner"/> initialized with the specified configuration.</returns>
|
||||
public override EssentialsDevice BuildDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new EssentialsRoomCombiner Device");
|
||||
var props = dc.Properties.ToObject<EssentialsRoomCombinerPropertiesConfig>();
|
||||
|
||||
var props = dc.Properties.ToObject<EssentialsRoomCombinerPropertiesConfig>();
|
||||
|
||||
return new EssentialsRoomCombiner(dc.Key, props);
|
||||
}
|
||||
return new EssentialsRoomCombiner(dc.Key, props);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
|
@ -11,10 +12,10 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class EssentialsRoomCombinerPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the system operates in automatic mode.
|
||||
/// <remarks>Some systems don't have partitions sensors, and show shouldn't allow auto mode to be turned on. When this is true in the configuration,
|
||||
/// auto mode won't be allowed to be turned on.</remarks>
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the system operates in automatic mode.
|
||||
/// <remarks>Some systems don't have partitions sensors, and show shouldn't allow auto mode to be turned on. When this is true in the configuration,
|
||||
/// auto mode won't be allowed to be turned on.</remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("disableAutoMode")]
|
||||
public bool DisableAutoMode { get; set; }
|
||||
|
|
@ -49,8 +50,8 @@ namespace PepperDash.Essentials.Core
|
|||
[JsonProperty("defaultScenarioKey")]
|
||||
public string defaultScenarioKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the debounce time, in seconds, for scenario changes.
|
||||
/// <summary>
|
||||
/// Gets or sets the debounce time, in seconds, for scenario changes.
|
||||
/// </summary>
|
||||
[JsonProperty("scenarioChangeDebounceTimeSeconds")]
|
||||
public int ScenarioChangeDebounceTimeSeconds { get; set; }
|
||||
|
|
@ -61,14 +62,14 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class PartitionConfig : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique key associated with the object.
|
||||
/// <summary>
|
||||
/// Gets or sets the unique key associated with the object.
|
||||
/// </summary>
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name associated with the object.
|
||||
/// <summary>
|
||||
/// Gets or sets the name associated with the object.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
|
@ -91,26 +92,26 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class RoomCombinationScenarioConfig : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the key associated with the object.
|
||||
/// <summary>
|
||||
/// Gets or sets the key associated with the object.
|
||||
/// </summary>
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name associated with the object.
|
||||
/// <summary>
|
||||
/// Gets or sets the name associated with the object.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to hide this scenario in the UI.
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to hide this scenario in the UI.
|
||||
/// </summary>
|
||||
[JsonProperty("hideInUi", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool HideInUi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collection of partition states.
|
||||
public bool HideInUi { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collection of partition states.
|
||||
/// </summary>
|
||||
[JsonProperty("partitionStates")]
|
||||
public List<PartitionState> PartitionStates { get; set; }
|
||||
|
|
@ -121,14 +122,14 @@ namespace PepperDash.Essentials.Core
|
|||
[JsonProperty("uiMap")]
|
||||
public Dictionary<string, string> UiMap { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of actions to be performed during device activation.
|
||||
/// <summary>
|
||||
/// Gets or sets the list of actions to be performed during device activation.
|
||||
/// </summary>
|
||||
[JsonProperty("activationActions")]
|
||||
public List<DeviceActionWrapper> ActivationActions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of actions to be performed when a device is deactivated.
|
||||
/// <summary>
|
||||
/// Gets or sets the list of actions to be performed when a device is deactivated.
|
||||
/// </summary>
|
||||
[JsonProperty("deactivationActions")]
|
||||
public List<DeviceActionWrapper> DeactivationActions { get; set; }
|
||||
|
|
@ -139,16 +140,16 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class PartitionState
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the partition key used to group and organize data within a storage system.
|
||||
/// <summary>
|
||||
/// Gets or sets the partition key used to group and organize data within a storage system.
|
||||
/// </summary>
|
||||
[JsonProperty("partitionKey")]
|
||||
public string PartitionKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether a partition is currently present.
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether a partition is currently present.
|
||||
/// </summary>
|
||||
[JsonProperty("partitionSensedState")]
|
||||
public bool PartitionPresent { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsDualDisplayRoomPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsDualDisplayRoomPropertiesConfig : EssentialsNDisplayRoomPropertiesConfig
|
||||
{
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the configuration properties for a dual display room.
|
||||
/// </summary>
|
||||
public class EssentialsDualDisplayRoomPropertiesConfig : EssentialsNDisplayRoomPropertiesConfig
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +1,33 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration class for huddle room properties
|
||||
/// </summary>
|
||||
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsHuddleRoomPropertiesConfig
|
||||
/// The key of the default display device
|
||||
/// </summary>
|
||||
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the default display device
|
||||
/// </summary>
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the default audio device
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
/// <summary>
|
||||
/// The key of the default audio device
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the source list for the room
|
||||
/// </summary>
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
/// <summary>
|
||||
/// The key of the source list for the room
|
||||
/// </summary>
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the default source item from the source list
|
||||
/// </summary>
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// The key of the default source item from the source list
|
||||
/// </summary>
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
}
|
||||
|
|
@ -1,19 +1,16 @@
|
|||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsHuddleVtc1PropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsHuddleVtc1PropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsHuddleVtc1PropertiesConfig
|
||||
/// Gets or sets the DefaultDisplayKey
|
||||
/// </summary>
|
||||
public class EssentialsHuddleVtc1PropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultDisplayKey
|
||||
/// </summary>
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,55 +4,55 @@ using Newtonsoft.Json;
|
|||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsNDisplayRoomPropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultAudioBehavior
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioBehavior")]
|
||||
public string DefaultAudioBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultVideoBehavior
|
||||
/// </summary>
|
||||
[JsonProperty("defaultVideoBehavior")]
|
||||
public string DefaultVideoBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Displays
|
||||
/// </summary>
|
||||
[JsonProperty("displays")]
|
||||
public Dictionary<eSourceListItemDestinationTypes, DisplayItem> Displays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsNDisplayRoomPropertiesConfig()
|
||||
{
|
||||
Displays = new Dictionary<eSourceListItemDestinationTypes, DisplayItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a DisplayItem
|
||||
/// </summary>
|
||||
public class DisplayItem : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Gets or sets the Key
|
||||
/// </summary>
|
||||
public class EssentialsNDisplayRoomPropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultAudioBehavior
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioBehavior")]
|
||||
public string DefaultAudioBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultVideoBehavior
|
||||
/// </summary>
|
||||
[JsonProperty("defaultVideoBehavior")]
|
||||
public string DefaultVideoBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Displays
|
||||
/// </summary>
|
||||
[JsonProperty("displays")]
|
||||
public Dictionary<eSourceListItemDestinationTypes, DisplayItem> Displays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsNDisplayRoomPropertiesConfig()
|
||||
{
|
||||
Displays = new Dictionary<eSourceListItemDestinationTypes, DisplayItem>();
|
||||
}
|
||||
|
||||
}
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a DisplayItem
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
public class DisplayItem : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Key
|
||||
/// </summary>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,70 +7,71 @@ using PepperDash.Essentials.Core;
|
|||
using PepperDash.Essentials.Core.Privacy;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Helper class for EssentialsRoomConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomConfigHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomConfigHelper
|
||||
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
||||
/// Returns null if there is no emergency defined
|
||||
/// </summary>
|
||||
public class EssentialsRoomConfigHelper
|
||||
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
|
||||
{
|
||||
/// <summary>
|
||||
/// GetEmergency method
|
||||
/// </summary>
|
||||
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
|
||||
// This emergency
|
||||
var emergency = props.Emergency;
|
||||
if (emergency != null)
|
||||
{
|
||||
// This emergency
|
||||
var emergency = props.Emergency;
|
||||
if (emergency != null)
|
||||
{
|
||||
//switch on emergency type here. Right now only contact and shutdown
|
||||
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
|
||||
DeviceManager.AddDevice(e);
|
||||
return e;
|
||||
}
|
||||
//switch on emergency type here. Right now only contact and shutdown
|
||||
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
|
||||
DeviceManager.AddDevice(e);
|
||||
return e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="props"></param>
|
||||
/// <param name="room"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetMicrophonePrivacy method
|
||||
/// </summary>
|
||||
public static MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
EssentialsRoomPropertiesConfig props, IPrivacy room)
|
||||
{
|
||||
var microphonePrivacy = props.MicrophonePrivacy;
|
||||
if (microphonePrivacy == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Cannot create microphone privacy with null properties");
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="props"></param>
|
||||
/// <param name="room"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetMicrophonePrivacy method
|
||||
/// </summary>
|
||||
public static MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
EssentialsRoomPropertiesConfig props, IPrivacy room)
|
||||
// Get the MicrophonePrivacy device from the device manager
|
||||
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as MicrophonePrivacyController);
|
||||
// Set this room as the IPrivacy device
|
||||
if (mP == null)
|
||||
{
|
||||
var microphonePrivacy = props.MicrophonePrivacy;
|
||||
if (microphonePrivacy == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Cannot create microphone privacy with null properties");
|
||||
return null;
|
||||
}
|
||||
// Get the MicrophonePrivacy device from the device manager
|
||||
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as MicrophonePrivacyController);
|
||||
// Set this room as the IPrivacy device
|
||||
if (mP == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
|
||||
return null;
|
||||
}
|
||||
mP.SetPrivacyDevice(room);
|
||||
Debug.LogMessage(LogEventLevel.Information, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
|
||||
return null;
|
||||
}
|
||||
mP.SetPrivacyDevice(room);
|
||||
|
||||
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
|
||||
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
|
||||
|
||||
if (behaviour == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "WARNING: No behaviour defined for MicrophonePrivacyController");
|
||||
return null;
|
||||
}
|
||||
if (behaviour == "trackroomstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
var essRoom = room as IEssentialsRoom;
|
||||
essRoom.OnFeedback.OutputChange += (o, a) =>
|
||||
if (behaviour == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "WARNING: No behaviour defined for MicrophonePrivacyController");
|
||||
return null;
|
||||
}
|
||||
if (behaviour == "trackroomstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
var essRoom = room as IEssentialsRoom;
|
||||
essRoom.OnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (essRoom.OnFeedback.BoolValue)
|
||||
mP.EnableLeds = true;
|
||||
|
|
@ -78,13 +79,13 @@ namespace PepperDash.Essentials.Room.Config
|
|||
mP.EnableLeds = false;
|
||||
};
|
||||
|
||||
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
|
||||
}
|
||||
else if (behaviour == "trackcallstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
var inCallRoom = room as IHasInCallFeedback;
|
||||
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
|
||||
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
|
||||
}
|
||||
else if (behaviour == "trackcallstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
var inCallRoom = room as IHasInCallFeedback;
|
||||
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (inCallRoom.InCallFeedback.BoolValue)
|
||||
mP.EnableLeds = true;
|
||||
|
|
@ -92,477 +93,335 @@ namespace PepperDash.Essentials.Room.Config
|
|||
mP.EnableLeds = false;
|
||||
};
|
||||
|
||||
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
|
||||
}
|
||||
|
||||
return mP;
|
||||
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
|
||||
}
|
||||
|
||||
return mP;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("addresses")]
|
||||
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomPropertiesConfig
|
||||
/// Gets or sets the Description
|
||||
/// </summary>
|
||||
public class EssentialsRoomPropertiesConfig
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Emergency
|
||||
/// </summary>
|
||||
[JsonProperty("emergency")]
|
||||
public EssentialsRoomEmergencyConfig Emergency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Help
|
||||
/// </summary>
|
||||
[JsonProperty("help")]
|
||||
public EssentialsHelpPropertiesConfig Help { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HelpMessage
|
||||
/// </summary>
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Read this value to get the help message. It checks for the old and new config format.
|
||||
/// </summary>
|
||||
public string HelpMessageForDisplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Addresses
|
||||
/// </summary>
|
||||
[JsonProperty("addresses")]
|
||||
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Description
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Emergency
|
||||
/// </summary>
|
||||
[JsonProperty("emergency")]
|
||||
public EssentialsRoomEmergencyConfig Emergency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Help
|
||||
/// </summary>
|
||||
[JsonProperty("help")]
|
||||
public EssentialsHelpPropertiesConfig Help { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HelpMessage
|
||||
/// </summary>
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Read this value to get the help message. It checks for the old and new config format.
|
||||
/// </summary>
|
||||
public string HelpMessageForDisplay
|
||||
get
|
||||
{
|
||||
get
|
||||
if (Help != null && !string.IsNullOrEmpty(Help.Message))
|
||||
{
|
||||
if (Help != null && !string.IsNullOrEmpty(Help.Message))
|
||||
{
|
||||
return Help.Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
return HelpMessage;
|
||||
}
|
||||
return Help.Message;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Environment
|
||||
/// </summary>
|
||||
[JsonProperty("environment")]
|
||||
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the LogoLight
|
||||
/// </summary>
|
||||
[JsonProperty("logo")]
|
||||
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the LogoDark
|
||||
/// </summary>
|
||||
[JsonProperty("logoDark")]
|
||||
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MicrophonePrivacy
|
||||
/// </summary>
|
||||
[JsonProperty("microphonePrivacy")]
|
||||
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Occupancy
|
||||
/// </summary>
|
||||
[JsonProperty("occupancy")]
|
||||
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the OneButtonMeeting
|
||||
/// </summary>
|
||||
[JsonProperty("oneButtonMeeting")]
|
||||
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownVacancySeconds
|
||||
/// </summary>
|
||||
[JsonProperty("shutdownVacancySeconds")]
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownPromptSeconds
|
||||
/// </summary>
|
||||
[JsonProperty("shutdownPromptSeconds")]
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Tech
|
||||
/// </summary>
|
||||
[JsonProperty("tech")]
|
||||
public EssentialsRoomTechConfig Tech { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Volumes
|
||||
/// </summary>
|
||||
[JsonProperty("volumes")]
|
||||
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Fusion
|
||||
/// </summary>
|
||||
[JsonProperty("fusion")]
|
||||
public EssentialsRoomFusionConfig Fusion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UiBehavior
|
||||
/// </summary>
|
||||
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ZeroVolumeWhenSwtichingVolumeDevices
|
||||
/// </summary>
|
||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this room represents a combination of other rooms
|
||||
/// </summary>
|
||||
[JsonProperty("isRoomCombinationScenario")]
|
||||
public bool IsRoomCombinationScenario { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsRoomPropertiesConfig()
|
||||
{
|
||||
LogoLight = new EssentialsLogoPropertiesConfig();
|
||||
LogoDark = new EssentialsLogoPropertiesConfig();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomUiBehaviorConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomUiBehaviorConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DisableActivityButtonsWhileWarmingCooling
|
||||
/// </summary>
|
||||
[JsonProperty("disableActivityButtonsWhileWarmingCooling")]
|
||||
public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsAvRoomPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultAudioKey
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultOnDspPresetKey
|
||||
/// </summary>
|
||||
[JsonProperty("defaultOnDspPresetKey")]
|
||||
public string DefaultOnDspPresetKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultOffDspPresetKey
|
||||
/// </summary>
|
||||
[JsonProperty("defaultOffDspPresetKey")]
|
||||
public string DefaultOffDspPresetKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SourceListKey
|
||||
/// </summary>
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the DestinationListKey
|
||||
/// </summary>
|
||||
[JsonProperty("destinationListKey")]
|
||||
public string DestinationListKey { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioControlPointListKey
|
||||
/// </summary>
|
||||
[JsonProperty("audioControlPointListKey")]
|
||||
public string AudioControlPointListKey { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the CameraListKey
|
||||
/// </summary>
|
||||
[JsonProperty("cameraListKey")]
|
||||
public string CameraListKey { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DefaultSourceItem
|
||||
/// </summary>
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the room supports advanced sharing
|
||||
/// </summary>
|
||||
[JsonProperty("supportsAdvancedSharing")]
|
||||
public bool SupportsAdvancedSharing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if non-tech users can change the share mode
|
||||
/// </summary>
|
||||
[JsonProperty("userCanChangeShareMode")]
|
||||
public bool UserCanChangeShareMode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MatrixRoutingKey
|
||||
/// </summary>
|
||||
[JsonProperty("matrixRoutingKey", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string MatrixRoutingKey { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsConferenceRoomPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the VideoCodecKey
|
||||
/// </summary>
|
||||
[JsonProperty("videoCodecKey")]
|
||||
public string VideoCodecKey { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioCodecKey
|
||||
/// </summary>
|
||||
[JsonProperty("audioCodecKey")]
|
||||
public string AudioCodecKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsEnvironmentPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsEnvironmentPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Enabled
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DeviceKeys
|
||||
/// </summary>
|
||||
[JsonProperty("deviceKeys")]
|
||||
public List<string> DeviceKeys { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsEnvironmentPropertiesConfig()
|
||||
{
|
||||
DeviceKeys = new List<string>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomFusionConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomFusionConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the the IpId as a UInt16
|
||||
/// </summary>
|
||||
public uint IpIdInt
|
||||
{
|
||||
get
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
return Convert.ToUInt32(IpId, 16);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
||||
}
|
||||
|
||||
return HelpMessage;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IpId
|
||||
/// </summary>
|
||||
[JsonProperty("ipId")]
|
||||
public string IpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JoinMapKey
|
||||
/// </summary>
|
||||
[JsonProperty("joinMapKey")]
|
||||
public string JoinMapKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomMicrophonePrivacyConfig
|
||||
/// Gets or sets the Environment
|
||||
/// </summary>
|
||||
public class EssentialsRoomMicrophonePrivacyConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DeviceKey
|
||||
/// </summary>
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Behaviour
|
||||
/// </summary>
|
||||
[JsonProperty("behaviour")]
|
||||
public string Behaviour { get; set; }
|
||||
}
|
||||
[JsonProperty("environment")]
|
||||
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsHelpPropertiesConfig
|
||||
/// Gets or sets the LogoLight
|
||||
/// </summary>
|
||||
public class EssentialsHelpPropertiesConfig
|
||||
[JsonProperty("logo")]
|
||||
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the LogoDark
|
||||
/// </summary>
|
||||
[JsonProperty("logoDark")]
|
||||
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MicrophonePrivacy
|
||||
/// </summary>
|
||||
[JsonProperty("microphonePrivacy")]
|
||||
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Occupancy
|
||||
/// </summary>
|
||||
[JsonProperty("occupancy")]
|
||||
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the OneButtonMeeting
|
||||
/// </summary>
|
||||
[JsonProperty("oneButtonMeeting")]
|
||||
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownVacancySeconds
|
||||
/// </summary>
|
||||
[JsonProperty("shutdownVacancySeconds")]
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownPromptSeconds
|
||||
/// </summary>
|
||||
[JsonProperty("shutdownPromptSeconds")]
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Tech
|
||||
/// </summary>
|
||||
[JsonProperty("tech")]
|
||||
public EssentialsRoomTechConfig Tech { get; set; }
|
||||
|
||||
[JsonProperty("fusion")]
|
||||
public EssentialsRoomFusionConfig Fusion { get; set; }
|
||||
|
||||
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ZeroVolumeWhenSwtichingVolumeDevices
|
||||
/// </summary>
|
||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this room represents a combination of other rooms
|
||||
/// </summary>
|
||||
[JsonProperty("isRoomCombinationScenario")]
|
||||
public bool IsRoomCombinationScenario { get; set; }
|
||||
|
||||
public EssentialsRoomPropertiesConfig()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Message
|
||||
/// </summary>
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
LogoLight = new EssentialsLogoPropertiesConfig();
|
||||
LogoDark = new EssentialsLogoPropertiesConfig();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShowCallButton
|
||||
/// </summary>
|
||||
[JsonProperty("showCallButton")]
|
||||
public bool ShowCallButton { get; set; }
|
||||
public class EssentialsRoomUiBehaviorConfig
|
||||
{
|
||||
[JsonProperty("disableActivityButtonsWhileWarmingCooling")]
|
||||
public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to "Call Help Desk"
|
||||
/// </summary>
|
||||
[JsonProperty("callButtonText")]
|
||||
public string CallButtonText { get; set; }
|
||||
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
[JsonProperty("destinationListKey")]
|
||||
public string DestinationListKey { get; set; }
|
||||
[JsonProperty("audioControlPointListKey")]
|
||||
public string AudioControlPointListKey { get; set; }
|
||||
[JsonProperty("cameraListKey")]
|
||||
public string CameraListKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsHelpPropertiesConfig()
|
||||
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the room supports advanced sharing
|
||||
/// </summary>
|
||||
[JsonProperty("supportsAdvancedSharing")]
|
||||
public bool SupportsAdvancedSharing { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if non-tech users can change the share mode
|
||||
/// </summary>
|
||||
[JsonProperty("userCanChangeShareMode")]
|
||||
public bool UserCanChangeShareMode { get; set; }
|
||||
|
||||
|
||||
[JsonProperty("matrixRoutingKey", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string MatrixRoutingKey { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("videoCodecKey")]
|
||||
public string VideoCodecKey { get; set; }
|
||||
[JsonProperty("audioCodecKey")]
|
||||
public string AudioCodecKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsEnvironmentPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsEnvironmentPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Enabled
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
[JsonProperty("deviceKeys")]
|
||||
public List<string> DeviceKeys { get; set; }
|
||||
|
||||
public EssentialsEnvironmentPropertiesConfig()
|
||||
{
|
||||
DeviceKeys = new List<string>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class EssentialsRoomFusionConfig
|
||||
{
|
||||
public uint IpIdInt
|
||||
{
|
||||
get
|
||||
{
|
||||
CallButtonText = "Call Help Desk";
|
||||
try
|
||||
{
|
||||
return Convert.ToUInt32(IpId, 16);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsOneButtonMeetingPropertiesConfig
|
||||
/// </summary>
|
||||
public class EssentialsOneButtonMeetingPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Enable
|
||||
/// </summary>
|
||||
[JsonProperty("enable")]
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
[JsonProperty("ipId")]
|
||||
public string IpId { get; set; }
|
||||
|
||||
[JsonProperty("joinMapKey")]
|
||||
public string JoinMapKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class EssentialsRoomMicrophonePrivacyConfig
|
||||
{
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
[JsonProperty("behaviour")]
|
||||
public string Behaviour { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Properties for the help text box
|
||||
/// </summary>
|
||||
public class EssentialsHelpPropertiesConfig
|
||||
{
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
|
||||
[JsonProperty("showCallButton")]
|
||||
public bool ShowCallButton { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomAddressPropertiesConfig
|
||||
/// Defaults to "Call Help Desk"
|
||||
/// </summary>
|
||||
public class EssentialsRoomAddressPropertiesConfig
|
||||
[JsonProperty("callButtonText")]
|
||||
public string CallButtonText { get; set; }
|
||||
|
||||
public EssentialsHelpPropertiesConfig()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the PhoneNumber
|
||||
/// </summary>
|
||||
[JsonProperty("phoneNumber")]
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SipAddress
|
||||
/// </summary>
|
||||
[JsonProperty("sipAddress")]
|
||||
public string SipAddress { get; set; }
|
||||
CallButtonText = "Call Help Desk";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsOneButtonMeetingPropertiesConfig
|
||||
{
|
||||
[JsonProperty("enable")]
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsRoomAddressPropertiesConfig
|
||||
{
|
||||
[JsonProperty("phoneNumber")]
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
[JsonProperty("sipAddress")]
|
||||
public string SipAddress { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Properties for the room's logo on panels
|
||||
/// </summary>
|
||||
public class EssentialsLogoPropertiesConfig
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
/// <summary>
|
||||
/// Represents a EssentialsLogoPropertiesConfig
|
||||
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
|
||||
/// </summary>
|
||||
public class EssentialsLogoPropertiesConfig
|
||||
public string GetLogoUrlLight()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Type
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Url
|
||||
/// </summary>
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// GetLogoUrlLight method
|
||||
/// </summary>
|
||||
public string GetLogoUrlLight()
|
||||
{
|
||||
if (Type == "url")
|
||||
return Url;
|
||||
if (Type == "system")
|
||||
return string.Format("http://{0}:8080/logo.png",
|
||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GetLogoUrlDark method
|
||||
/// </summary>
|
||||
public string GetLogoUrlDark()
|
||||
{
|
||||
if (Type == "url")
|
||||
return Url;
|
||||
if (Type == "system")
|
||||
return string.Format("http://{0}:8080/logo-dark.png",
|
||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||
return null;
|
||||
}
|
||||
if (Type == "url")
|
||||
return Url;
|
||||
if (Type == "system")
|
||||
return string.Format("http://{0}:8080/logo.png",
|
||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomOccSensorConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomOccSensorConfig
|
||||
public string GetLogoUrlDark()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DeviceKey
|
||||
/// </summary>
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TimeoutMinutes
|
||||
/// </summary>
|
||||
[JsonProperty("timeoutMinutes")]
|
||||
public int TimeoutMinutes { get; set; }
|
||||
if (Type == "url")
|
||||
return Url;
|
||||
if (Type == "system")
|
||||
return string.Format("http://{0}:8080/logo-dark.png",
|
||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomTechConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomTechConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Password
|
||||
/// </summary>
|
||||
[JsonProperty("password")]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Represents occupancy sensor(s) setup for a room
|
||||
/// </summary>
|
||||
public class EssentialsRoomOccSensorConfig
|
||||
{
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
[JsonProperty("timeoutMinutes")]
|
||||
public int TimeoutMinutes { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsRoomTechConfig
|
||||
{
|
||||
[JsonProperty("password")]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,29 @@
|
|||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsRoomEmergencyConfig
|
||||
{
|
||||
public EssentialsRoomEmergencyTriggerConfig Trigger { get; set; }
|
||||
|
||||
public string Behavior { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsRoomEmergencyTriggerConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomEmergencyConfig
|
||||
/// contact,versiport
|
||||
/// </summary>
|
||||
public class EssentialsRoomEmergencyConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Trigger
|
||||
/// </summary>
|
||||
public EssentialsRoomEmergencyTriggerConfig Trigger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Behavior
|
||||
/// </summary>
|
||||
public string Behavior { get; set; }
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomEmergencyTriggerConfig
|
||||
/// Input number if contact
|
||||
/// </summary>
|
||||
public class EssentialsRoomEmergencyTriggerConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// contact,versiport
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
public int Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Input number if contact
|
||||
/// </summary>
|
||||
public int Number { get; set; }
|
||||
public bool TriggerOnClose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TriggerOnClose indicates if the trigger is on close
|
||||
/// </summary>
|
||||
public bool TriggerOnClose { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -6,71 +6,71 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomScheduledEventsConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomScheduledEventsConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomScheduledEventsConfig
|
||||
/// Gets or sets the ScheduledEvents
|
||||
/// </summary>
|
||||
public class EssentialsRoomScheduledEventsConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ScheduledEvents
|
||||
/// </summary>
|
||||
[JsonProperty("scheduledEvents")]
|
||||
public List<ScheduledEventConfig> ScheduledEvents;
|
||||
}
|
||||
[JsonProperty("scheduledEvents")]
|
||||
public List<ScheduledEventConfig> ScheduledEvents;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a ScheduledEventConfig
|
||||
/// </summary>
|
||||
public class ScheduledEventConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Key
|
||||
/// </summary>
|
||||
[JsonProperty("key")]
|
||||
public string Key;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a ScheduledEventConfig
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
public class ScheduledEventConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Key
|
||||
/// </summary>
|
||||
[JsonProperty("key")]
|
||||
public string Key;
|
||||
[JsonProperty("name")]
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name;
|
||||
/// <summary>
|
||||
/// Gets or sets the Days
|
||||
/// </summary>
|
||||
[JsonProperty("days")]
|
||||
public ScheduledEventCommon.eWeekDays Days;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Days
|
||||
/// </summary>
|
||||
[JsonProperty("days")]
|
||||
public ScheduledEventCommon.eWeekDays Days;
|
||||
/// <summary>
|
||||
/// Gets or sets the Time
|
||||
/// </summary>
|
||||
[JsonProperty("time")]
|
||||
public string Time;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Time
|
||||
/// </summary>
|
||||
[JsonProperty("time")]
|
||||
public string Time;
|
||||
/// <summary>
|
||||
/// Gets or sets the Actions
|
||||
/// </summary>
|
||||
[JsonProperty("actions")]
|
||||
public List<DeviceActionWrapper> Actions;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Actions
|
||||
/// </summary>
|
||||
[JsonProperty("actions")]
|
||||
public List<DeviceActionWrapper> Actions;
|
||||
/// <summary>
|
||||
/// Gets or sets the Persistent
|
||||
/// </summary>
|
||||
[JsonProperty("persistent")]
|
||||
public bool Persistent;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Persistent
|
||||
/// </summary>
|
||||
[JsonProperty("persistent")]
|
||||
public bool Persistent;
|
||||
/// <summary>
|
||||
/// Gets or sets the Acknowledgeable
|
||||
/// </summary>
|
||||
[JsonProperty("acknowledgeable")]
|
||||
public bool Acknowledgeable;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Acknowledgeable
|
||||
/// </summary>
|
||||
[JsonProperty("acknowledgeable")]
|
||||
public bool Acknowledgeable;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Enable
|
||||
/// </summary>
|
||||
[JsonProperty("enable")]
|
||||
public bool Enable;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the Enable
|
||||
/// </summary>
|
||||
[JsonProperty("enable")]
|
||||
public bool Enable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,89 +1,87 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration class for the EssentialsTechRoom. This is used to deserialize the room configuration from JSON and provide it to the room on initialization.
|
||||
/// </summary>
|
||||
public class EssentialsTechRoomConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsTechRoomConfig
|
||||
/// The key of the dummy device used to enable routing
|
||||
/// </summary>
|
||||
public class EssentialsTechRoomConfig
|
||||
[JsonProperty("dummySourceKey")]
|
||||
public string DummySourceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the displays assigned to this room
|
||||
/// </summary>
|
||||
[JsonProperty("displays")]
|
||||
public List<string> Displays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the tuners assigned to this room
|
||||
/// </summary>
|
||||
[JsonProperty("tuners")]
|
||||
public List<string> Tuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a normal user
|
||||
/// </summary>
|
||||
[JsonProperty("userPin")]
|
||||
public string UserPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a tech user
|
||||
/// </summary>
|
||||
[JsonProperty("techPin")]
|
||||
public string TechPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the presets file. Path prefix is assumed to be /html/presets/lists/
|
||||
/// </summary>
|
||||
[JsonProperty("presetsFileName")]
|
||||
public string PresetsFileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of scheduled events for the room
|
||||
/// </summary>
|
||||
[JsonProperty("scheduledEvents")]
|
||||
public List<ScheduledEventConfig> ScheduledEvents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the room is the primary when true
|
||||
/// </summary>
|
||||
[JsonProperty("isPrimary")]
|
||||
public bool IsPrimary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
|
||||
/// </summary>
|
||||
[JsonProperty("mirroredTuners")]
|
||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Help message to show on the UI when the user clicks the help button. Can be used to provide room specific instructions for users.
|
||||
/// </summary>
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the room
|
||||
/// </summary>
|
||||
[JsonProperty("isTvPresetsProvider")]
|
||||
public bool IsTvPresetsProvider;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsTechRoomConfig()
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the dummy device used to enable routing
|
||||
/// </summary>
|
||||
[JsonProperty("dummySourceKey")]
|
||||
public string DummySourceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the displays assigned to this room
|
||||
/// </summary>
|
||||
[JsonProperty("displays")]
|
||||
public List<string> Displays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the tuners assigned to this room
|
||||
/// </summary>
|
||||
[JsonProperty("tuners")]
|
||||
public List<string> Tuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a normal user
|
||||
/// </summary>
|
||||
[JsonProperty("userPin")]
|
||||
public string UserPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a tech user
|
||||
/// </summary>
|
||||
[JsonProperty("techPin")]
|
||||
public string TechPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the presets file. Path prefix is assumed to be /html/presets/lists/
|
||||
/// </summary>
|
||||
[JsonProperty("presetsFileName")]
|
||||
public string PresetsFileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ScheduledEvents
|
||||
/// </summary>
|
||||
[JsonProperty("scheduledEvents")]
|
||||
public List<ScheduledEventConfig> ScheduledEvents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the room is the primary when true
|
||||
/// </summary>
|
||||
[JsonProperty("isPrimary")]
|
||||
public bool IsPrimary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
|
||||
/// </summary>
|
||||
[JsonProperty("mirroredTuners")]
|
||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HelpMessage
|
||||
/// </summary>
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsTvPresetsProvider
|
||||
/// </summary>
|
||||
[JsonProperty("isTvPresetsProvider")]
|
||||
public bool IsTvPresetsProvider;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public EssentialsTechRoomConfig()
|
||||
{
|
||||
Displays = new List<string>();
|
||||
Tuners = new List<string>();
|
||||
ScheduledEvents = new List<ScheduledEventConfig>();
|
||||
}
|
||||
Displays = new List<string>();
|
||||
Tuners = new List<string>();
|
||||
ScheduledEvents = new List<ScheduledEventConfig>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,115 +1,35 @@
|
|||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration class for volume levels in the Essentials room. This is used to configure the volume levels for the master, program, audio call receive, and audio call transmit channels in the room.
|
||||
/// </summary>
|
||||
[Obsolete("This class is being deprecated in favor audio control point lists in the main config. It is recommended to use the DeviceKey property to get the device from the main system and then cast it to the correct type.")]
|
||||
public class EssentialsRoomVolumesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomVolumesConfig
|
||||
/// </summary>
|
||||
public class EssentialsRoomVolumesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Master
|
||||
/// </summary>
|
||||
public EssentialsVolumeLevelConfig Master { get; set; }
|
||||
public EssentialsVolumeLevelConfig Master { get; set; }
|
||||
public EssentialsVolumeLevelConfig Program { get; set; }
|
||||
public EssentialsVolumeLevelConfig AudioCallRx { get; set; }
|
||||
public EssentialsVolumeLevelConfig AudioCallTx { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Program
|
||||
/// </summary>
|
||||
public EssentialsVolumeLevelConfig Program { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioCallRx
|
||||
/// </summary>
|
||||
public EssentialsVolumeLevelConfig AudioCallRx { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioCallTx
|
||||
/// </summary>
|
||||
public EssentialsVolumeLevelConfig AudioCallTx { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration class for a volume level in the Essentials room.
|
||||
/// </summary>
|
||||
public class EssentialsVolumeLevelConfig
|
||||
{
|
||||
public string DeviceKey { get; set; }
|
||||
public string Label { get; set; }
|
||||
public int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a EssentialsVolumeLevelConfig
|
||||
/// Helper to get the device associated with key - one timer.
|
||||
/// </summary>
|
||||
public class EssentialsVolumeLevelConfig
|
||||
[Obsolete("This method references DM CHASSIS Directly and should not be used in the Core library. It is recommended to use the DeviceKey property to get the device from the main system and then cast it to the correct type.")]
|
||||
public IBasicVolumeWithFeedback GetDevice()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the DeviceKey
|
||||
/// </summary>
|
||||
public string DeviceKey { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the Label
|
||||
/// </summary>
|
||||
public string Label { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the Level
|
||||
/// </summary>
|
||||
public int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helper to get the device associated with key - one timer.
|
||||
/// </summary>
|
||||
public IBasicVolumeWithFeedback GetDevice()
|
||||
{
|
||||
throw new NotImplementedException("This method references DM CHASSIS Directly");
|
||||
/*
|
||||
// DM output card format: deviceKey--output~number, dm8x8-1--output~4
|
||||
var match = Regex.Match(DeviceKey, @"([-_\w]+)--(\w+)~(\d+)");
|
||||
if (match.Success)
|
||||
{
|
||||
var devKey = match.Groups[1].Value;
|
||||
var chassis = DeviceManager.GetDeviceForKey(devKey) as DmChassisController;
|
||||
if (chassis != null)
|
||||
{
|
||||
var outputNum = Convert.ToUInt32(match.Groups[3].Value);
|
||||
if (chassis.VolumeControls.ContainsKey(outputNum)) // should always...
|
||||
return chassis.VolumeControls[outputNum];
|
||||
}
|
||||
// No volume for some reason. We have failed as developers
|
||||
return null;
|
||||
}
|
||||
|
||||
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master
|
||||
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
||||
if (match.Success)
|
||||
{
|
||||
var devKey = match.Groups[1].Value;
|
||||
var dsp = DeviceManager.GetDeviceForKey(devKey) as BiampTesiraForteDsp;
|
||||
if (dsp != null)
|
||||
{
|
||||
var levelTag = match.Groups[2].Value;
|
||||
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
||||
return dsp.LevelControlPoints[levelTag];
|
||||
}
|
||||
|
||||
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
|
||||
if (dmps != null)
|
||||
{
|
||||
var levelTag = match.Groups[2].Value;
|
||||
switch (levelTag)
|
||||
{
|
||||
case "master":
|
||||
return dmps.MasterVolumeLevel;
|
||||
case "source":
|
||||
return dmps.SourceVolumeLevel;
|
||||
case "micsmaster":
|
||||
return dmps.MicsMasterVolumeLevel;
|
||||
case "codec1":
|
||||
return dmps.Codec1VolumeLevel;
|
||||
case "codec2":
|
||||
return dmps.Codec2VolumeLevel;
|
||||
default:
|
||||
return dmps.MasterVolumeLevel;
|
||||
}
|
||||
}
|
||||
// No volume for some reason. We have failed as developers
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
* */
|
||||
}
|
||||
throw new NotImplementedException("This method references DM CHASSIS Directly and should not be used in the Core library. It is recommended to use the DeviceKey property to get the device from the main system and then cast it to the correct type.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +1,52 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
namespace PepperDash.Essentials.Room.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a SimplRoomPropertiesConfig
|
||||
/// </summary>
|
||||
public class SimplRoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a SimplRoomPropertiesConfig
|
||||
/// </summary>
|
||||
public class SimplRoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomPhoneNumber
|
||||
/// </summary>
|
||||
[JsonProperty("roomPhoneNumber")]
|
||||
public string RoomPhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomURI
|
||||
/// </summary>
|
||||
[JsonProperty("roomURI")]
|
||||
public string RoomURI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SpeedDials
|
||||
/// </summary>
|
||||
[JsonProperty("speedDials")]
|
||||
public List<SimplSpeedDial> SpeedDials { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the VolumeSliderNames
|
||||
/// </summary>
|
||||
[JsonProperty("volumeSliderNames")]
|
||||
public List<string> VolumeSliderNames { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomPhoneNumber
|
||||
/// </summary>
|
||||
[JsonProperty("roomPhoneNumber")]
|
||||
public string RoomPhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a SimplSpeedDial
|
||||
/// Gets or sets the RoomURI
|
||||
/// </summary>
|
||||
public class SimplSpeedDial
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Number
|
||||
/// </summary>
|
||||
[JsonProperty("number")]
|
||||
public string Number { get; set; }
|
||||
}
|
||||
[JsonProperty("roomURI")]
|
||||
public string RoomURI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SpeedDials
|
||||
/// </summary>
|
||||
[JsonProperty("speedDials")]
|
||||
public List<SimplSpeedDial> SpeedDials { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the VolumeSliderNames
|
||||
/// </summary>
|
||||
[JsonProperty("volumeSliderNames")]
|
||||
public List<string> VolumeSliderNames { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a SimplSpeedDial
|
||||
/// </summary>
|
||||
public class SimplSpeedDial
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Number
|
||||
/// </summary>
|
||||
[JsonProperty("number")]
|
||||
public string Number { get; set; }
|
||||
}
|
||||
|
|
@ -2,116 +2,94 @@
|
|||
using Crestron.SimplSharpPro;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
public class EssentialsRoomEmergencyContactClosure : EssentialsRoomEmergencyBase, IEssentialsRoomEmergency
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a EssentialsRoomEmergencyContactClosure
|
||||
/// </summary>
|
||||
public class EssentialsRoomEmergencyContactClosure : EssentialsRoomEmergencyBase, IEssentialsRoomEmergency
|
||||
public event EventHandler<EventArgs> EmergencyStateChange;
|
||||
|
||||
IEssentialsRoom Room;
|
||||
string Behavior;
|
||||
bool TriggerOnClose;
|
||||
|
||||
public bool InEmergency { get; private set; }
|
||||
|
||||
public EssentialsRoomEmergencyContactClosure(string key, EssentialsRoomEmergencyConfig config, IEssentialsRoom room) :
|
||||
base(key)
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when emergency state changes
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> EmergencyStateChange;
|
||||
Room = room;
|
||||
var cs = Global.ControlSystem;
|
||||
|
||||
IEssentialsRoom Room;
|
||||
string Behavior;
|
||||
bool TriggerOnClose;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the InEmergency
|
||||
/// </summary>
|
||||
public bool InEmergency { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for EssentialsRoomEmergencyContactClosure
|
||||
/// </summary>
|
||||
/// <param name="key">device key</param>
|
||||
/// <param name="config">emergency device config</param>
|
||||
/// <param name="room">the room associated with this emergency contact closure</param>
|
||||
public EssentialsRoomEmergencyContactClosure(string key, EssentialsRoomEmergencyConfig config, IEssentialsRoom room) :
|
||||
base(key)
|
||||
if (config.Trigger.Type.Equals("contact", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Room = room;
|
||||
var cs = Global.ControlSystem;
|
||||
|
||||
if (config.Trigger.Type.Equals("contact", StringComparison.OrdinalIgnoreCase))
|
||||
var portNum = (uint)config.Trigger.Number;
|
||||
if (portNum <= cs.NumberOfDigitalInputPorts)
|
||||
{
|
||||
var portNum = (uint)config.Trigger.Number;
|
||||
if (portNum <= cs.NumberOfDigitalInputPorts)
|
||||
{
|
||||
cs.DigitalInputPorts[portNum].Register();
|
||||
cs.DigitalInputPorts[portNum].StateChange += EsentialsRoomEmergencyContactClosure_StateChange;
|
||||
}
|
||||
}
|
||||
else if (config.Trigger.Type.Equals("versiport", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var portNum = (uint)config.Trigger.Number;
|
||||
if (portNum <= cs.NumberOfVersiPorts)
|
||||
{
|
||||
cs.VersiPorts[portNum].Register();
|
||||
cs.VersiPorts[portNum].SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
||||
cs.VersiPorts[portNum].DisablePullUpResistor = true;
|
||||
cs.VersiPorts[portNum].VersiportChange += EssentialsRoomEmergencyContactClosure_VersiportChange;
|
||||
}
|
||||
}
|
||||
Behavior = config.Behavior;
|
||||
TriggerOnClose = config.Trigger.TriggerOnClose;
|
||||
}
|
||||
|
||||
private void EssentialsRoomEmergencyContactClosure_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||
{
|
||||
if (args.Event == eVersiportEvent.DigitalInChange)
|
||||
{
|
||||
ContactClosure_StateChange(port.DigitalIn);
|
||||
cs.DigitalInputPorts[portNum].Register();
|
||||
cs.DigitalInputPorts[portNum].StateChange += EsentialsRoomEmergencyContactClosure_StateChange;
|
||||
}
|
||||
}
|
||||
|
||||
void EsentialsRoomEmergencyContactClosure_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
|
||||
else if (config.Trigger.Type.Equals("versiport", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ContactClosure_StateChange(args.State);
|
||||
}
|
||||
|
||||
void ContactClosure_StateChange(bool portState)
|
||||
{
|
||||
if (portState && TriggerOnClose || !portState && !TriggerOnClose)
|
||||
var portNum = (uint)config.Trigger.Number;
|
||||
if (portNum <= cs.NumberOfVersiPorts)
|
||||
{
|
||||
InEmergency = true;
|
||||
if (EmergencyStateChange != null)
|
||||
EmergencyStateChange(this, new EventArgs());
|
||||
RunEmergencyBehavior();
|
||||
}
|
||||
else
|
||||
{
|
||||
InEmergency = false;
|
||||
if (EmergencyStateChange != null)
|
||||
EmergencyStateChange(this, new EventArgs());
|
||||
cs.VersiPorts[portNum].Register();
|
||||
cs.VersiPorts[portNum].SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
||||
cs.VersiPorts[portNum].DisablePullUpResistor = true;
|
||||
cs.VersiPorts[portNum].VersiportChange += EssentialsRoomEmergencyContactClosure_VersiportChange;
|
||||
}
|
||||
}
|
||||
Behavior = config.Behavior;
|
||||
TriggerOnClose = config.Trigger.TriggerOnClose;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RunEmergencyBehavior method
|
||||
/// </summary>
|
||||
public void RunEmergencyBehavior()
|
||||
private void EssentialsRoomEmergencyContactClosure_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||
{
|
||||
if (args.Event == eVersiportEvent.DigitalInChange)
|
||||
{
|
||||
if (Behavior.Equals("shutdown"))
|
||||
Room.Shutdown();
|
||||
ContactClosure_StateChange(port.DigitalIn);
|
||||
}
|
||||
}
|
||||
|
||||
void EsentialsRoomEmergencyContactClosure_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
|
||||
{
|
||||
ContactClosure_StateChange(args.State);
|
||||
}
|
||||
|
||||
void ContactClosure_StateChange(bool portState)
|
||||
{
|
||||
if (portState && TriggerOnClose || !portState && !TriggerOnClose)
|
||||
{
|
||||
InEmergency = true;
|
||||
if (EmergencyStateChange != null)
|
||||
EmergencyStateChange(this, new EventArgs());
|
||||
RunEmergencyBehavior();
|
||||
}
|
||||
else
|
||||
{
|
||||
InEmergency = false;
|
||||
if (EmergencyStateChange != null)
|
||||
EmergencyStateChange(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IEssentialsRoomEmergency
|
||||
///
|
||||
/// </summary>
|
||||
public interface IEssentialsRoomEmergency
|
||||
public void RunEmergencyBehavior()
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when emergency state changes
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> EmergencyStateChange;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the InEmergency
|
||||
/// </summary>
|
||||
bool InEmergency { get; }
|
||||
if (Behavior.Equals("shutdown"))
|
||||
Room.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes the functionality of a room emergency contact closure
|
||||
/// </summary>
|
||||
public interface IEssentialsRoomEmergency
|
||||
{
|
||||
event EventHandler<EventArgs> EmergencyStateChange;
|
||||
|
||||
bool InEmergency { get; }
|
||||
}
|
||||
|
|
@ -12,259 +12,188 @@ using PepperDash.Essentials.Core.Devices;
|
|||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the RoomOccupancy object is set
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; private set; }
|
||||
|
||||
public IOccupancyStatusProvider RoomOccupancy { get; protected set; }
|
||||
|
||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||
|
||||
public List<EssentialsDevice> EnvironmentalControlDevices { get; protected set; }
|
||||
|
||||
public bool HasEnvironmentalControlDevices
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the RoomOccupancy object is set
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsWarmingUpFeedback
|
||||
/// </summary>
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsCoolingDownFeedback
|
||||
/// </summary>
|
||||
public BoolFeedback IsCoolingDownFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomOccupancy
|
||||
/// </summary>
|
||||
public IOccupancyStatusProvider RoomOccupancy { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the OccupancyStatusProviderIsRemote
|
||||
/// </summary>
|
||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the EnvironmentalControlDevices
|
||||
/// </summary>
|
||||
public List<EssentialsDevice> EnvironmentalControlDevices { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the room has any environmental control devices
|
||||
/// </summary>
|
||||
public bool HasEnvironmentalControlDevices
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return EnvironmentalControlDevices != null && EnvironmentalControlDevices.Count > 0;
|
||||
}
|
||||
return EnvironmentalControlDevices != null && EnvironmentalControlDevices.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsWarmingFeedbackFunc
|
||||
/// </summary>
|
||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsCoolingFeedbackFunc
|
||||
/// </summary>
|
||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||
/// <summary>
|
||||
/// Indicates if this room is Mobile Control Enabled
|
||||
/// </summary>
|
||||
public bool IsMobileControlEnabled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsMobileControlEnabled
|
||||
/// </summary>
|
||||
public bool IsMobileControlEnabled { get; private set; }
|
||||
/// <summary>
|
||||
/// The bridge for this room if Mobile Control is enabled
|
||||
/// </summary>
|
||||
public IMobileControlRoomMessenger MobileControlRoomBridge { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MobileControlRoomBridge
|
||||
/// </summary>
|
||||
public IMobileControlRoomMessenger MobileControlRoomBridge { get; private set; }
|
||||
protected const string _defaultListKey = "default";
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the default source list
|
||||
/// </summary>
|
||||
protected const string _defaultListKey = "default";
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
///
|
||||
private string _sourceListKey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SourceListKey
|
||||
/// </summary>
|
||||
public string SourceListKey {
|
||||
public string SourceListKey {
|
||||
get
|
||||
{
|
||||
if(string.IsNullOrEmpty(_sourceListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _sourceListKey;
|
||||
}
|
||||
if(string.IsNullOrEmpty(_sourceListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _sourceListKey;
|
||||
}
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != _sourceListKey)
|
||||
{
|
||||
_sourceListKey = value;
|
||||
}
|
||||
if (value != _sourceListKey)
|
||||
{
|
||||
_sourceListKey = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _destinationListKey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DestinationListKey
|
||||
/// </summary>
|
||||
public string DestinationListKey
|
||||
private string _destinationListKey;
|
||||
public string DestinationListKey
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
if (string.IsNullOrEmpty(_destinationListKey))
|
||||
{
|
||||
if (string.IsNullOrEmpty(_destinationListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _destinationListKey;
|
||||
}
|
||||
return _defaultListKey;
|
||||
}
|
||||
protected set
|
||||
else
|
||||
{
|
||||
if (value != _destinationListKey)
|
||||
{
|
||||
_destinationListKey = value;
|
||||
}
|
||||
return _destinationListKey;
|
||||
}
|
||||
}
|
||||
|
||||
private string _audioControlPointListKey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioControlPointListKey
|
||||
/// </summary>
|
||||
public string AudioControlPointListKey
|
||||
protected set
|
||||
{
|
||||
get
|
||||
if (value != _destinationListKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_audioControlPointListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _destinationListKey;
|
||||
}
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != _audioControlPointListKey)
|
||||
{
|
||||
_audioControlPointListKey = value;
|
||||
}
|
||||
_destinationListKey = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _cameraListKey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CameraListKey
|
||||
/// </summary>
|
||||
public string CameraListKey
|
||||
private string _audioControlPointListKey;
|
||||
public string AudioControlPointListKey
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
if (string.IsNullOrEmpty(_audioControlPointListKey))
|
||||
{
|
||||
if (string.IsNullOrEmpty(_cameraListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _cameraListKey;
|
||||
}
|
||||
return _defaultListKey;
|
||||
}
|
||||
protected set
|
||||
else
|
||||
{
|
||||
if (value != _cameraListKey)
|
||||
{
|
||||
_cameraListKey = value;
|
||||
}
|
||||
return _destinationListKey;
|
||||
}
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != _audioControlPointListKey)
|
||||
{
|
||||
_audioControlPointListKey = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownPromptTimer
|
||||
/// </summary>
|
||||
public SecondsCountdownTimer ShutdownPromptTimer { get; private set; }
|
||||
private string _cameraListKey;
|
||||
public string CameraListKey
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(_cameraListKey))
|
||||
{
|
||||
return _defaultListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _cameraListKey;
|
||||
}
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != _cameraListKey)
|
||||
{
|
||||
_cameraListKey = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownPromptSeconds
|
||||
/// </summary>
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
/// <summary>
|
||||
/// Timer used for informing the UIs of a shutdown
|
||||
/// </summary>
|
||||
public SecondsCountdownTimer ShutdownPromptTimer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownVacancySeconds
|
||||
/// </summary>
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
public eShutdownType ShutdownType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShutdownType
|
||||
/// </summary>
|
||||
public eShutdownType ShutdownType { get; private set; }
|
||||
public EssentialsRoomEmergencyBase Emergency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Emergency
|
||||
/// </summary>
|
||||
public EssentialsRoomEmergencyBase Emergency { get; set; }
|
||||
public Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MicrophonePrivacy
|
||||
/// </summary>
|
||||
public Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; set; }
|
||||
public string LogoUrlLightBkgnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the LogoUrlLightBkgnd
|
||||
/// </summary>
|
||||
public string LogoUrlLightBkgnd { get; set; }
|
||||
public string LogoUrlDarkBkgnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the LogoUrlDarkBkgnd
|
||||
/// </summary>
|
||||
public string LogoUrlDarkBkgnd { get; set; }
|
||||
protected SecondsCountdownTimer RoomVacancyShutdownTimer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomVacancyShutdownTimer
|
||||
/// </summary>
|
||||
protected SecondsCountdownTimer RoomVacancyShutdownTimer { get; private set; }
|
||||
public eVacancyMode VacancyMode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the VacancyMode
|
||||
/// </summary>
|
||||
public eVacancyMode VacancyMode { get; private set; }
|
||||
/// <summary>
|
||||
/// Seconds after vacancy prompt is displayed until shutdown
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy prompt is displayed until shutdown
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownSeconds;
|
||||
/// <summary>
|
||||
/// Seconds after vacancy detected until prompt is displayed
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownPromptSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy detected until prompt is displayed
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownPromptSeconds;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected abstract Func<bool> OnFeedbackFunc { get; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected abstract Func<bool> OnFeedbackFunc { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SavedVolumeLevels
|
||||
|
|
@ -276,362 +205,293 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for EssentialsRoomBase
|
||||
/// </summary>
|
||||
/// <param name="config">config of the device</param>
|
||||
public EssentialsRoomBase(DeviceConfig config)
|
||||
: base(config)
|
||||
|
||||
public EssentialsRoomBase(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
EnvironmentalControlDevices = new List<EssentialsDevice>();
|
||||
|
||||
// Setup the ShutdownPromptTimer
|
||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
EnvironmentalControlDevices = new List<EssentialsDevice>();
|
||||
if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
ShutdownType = eShutdownType.None;
|
||||
};
|
||||
|
||||
// Setup the ShutdownPromptTimer
|
||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
ShutdownType = eShutdownType.None;
|
||||
};
|
||||
ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
||||
|
||||
ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
||||
ShutdownPromptSeconds = 60;
|
||||
ShutdownVacancySeconds = 120;
|
||||
|
||||
ShutdownType = eShutdownType.None;
|
||||
|
||||
ShutdownPromptSeconds = 60;
|
||||
ShutdownVacancySeconds = 120;
|
||||
|
||||
ShutdownType = eShutdownType.None;
|
||||
RoomVacancyShutdownTimer = new SecondsCountdownTimer(Key + "-vacancyOffTimer");
|
||||
//RoomVacancyShutdownTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
//{
|
||||
// if (!RoomVacancyShutdownTimer.IsRunningFeedback.BoolValue)
|
||||
// ShutdownType = ShutdownType.Vacancy;
|
||||
//};
|
||||
RoomVacancyShutdownTimer.HasFinished += new EventHandler<EventArgs>(RoomVacancyShutdownPromptTimer_HasFinished); // Shutdown is triggered
|
||||
|
||||
RoomVacancyShutdownTimer = new SecondsCountdownTimer(Key + "-vacancyOffTimer");
|
||||
//RoomVacancyShutdownTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
//{
|
||||
// if (!RoomVacancyShutdownTimer.IsRunningFeedback.BoolValue)
|
||||
// ShutdownType = ShutdownType.Vacancy;
|
||||
//};
|
||||
RoomVacancyShutdownTimer.HasFinished += new EventHandler<EventArgs>(RoomVacancyShutdownPromptTimer_HasFinished); // Shutdown is triggered
|
||||
RoomVacancyShutdownPromptSeconds = 1500; // 25 min to prompt warning
|
||||
RoomVacancyShutdownSeconds = 240; // 4 min after prompt will trigger shutdown prompt
|
||||
VacancyMode = eVacancyMode.None;
|
||||
|
||||
RoomVacancyShutdownPromptSeconds = 1500; // 25 min to prompt warning
|
||||
RoomVacancyShutdownSeconds = 240; // 4 min after prompt will trigger shutdown prompt
|
||||
VacancyMode = eVacancyMode.None;
|
||||
OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
||||
|
||||
OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
||||
IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc);
|
||||
|
||||
IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc);
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
if (RoomOccupancy != null)
|
||||
OnRoomOccupancyIsSet();
|
||||
});
|
||||
}
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
if (RoomOccupancy != null)
|
||||
OnRoomOccupancyIsSet();
|
||||
});
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
SetUpMobileControl();
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the SourceListKey property to the passed in value or the default if no value passed in
|
||||
/// </summary>
|
||||
/// <param name="sourceListKey"></param>
|
||||
protected void SetSourceListKey(string sourceListKey)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sourceListKey))
|
||||
{
|
||||
SourceListKey = sourceListKey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CustomActivate method
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public override bool CustomActivate()
|
||||
else
|
||||
{
|
||||
SetUpMobileControl();
|
||||
|
||||
return base.CustomActivate();
|
||||
sourceListKey = _defaultListKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the SourceListKey property to the passed in value or the default if no value passed in
|
||||
/// </summary>
|
||||
/// <param name="sourceListKey"></param>
|
||||
protected void SetSourceListKey(string sourceListKey)
|
||||
protected void SetDestinationListKey(string destinationListKey)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(destinationListKey))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sourceListKey))
|
||||
{
|
||||
SourceListKey = sourceListKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceListKey = _defaultListKey;
|
||||
}
|
||||
DestinationListKey = destinationListKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the DestinationListKey property to the passed in value or the default if no value passed in
|
||||
/// </summary>
|
||||
/// <param name="destinationListKey">key of the destination list object</param>
|
||||
protected void SetDestinationListKey(string destinationListKey)
|
||||
/// <summary>
|
||||
/// If mobile control is enabled, sets the appropriate properties
|
||||
/// </summary>
|
||||
void SetUpMobileControl()
|
||||
{
|
||||
var mcBridgeKey = string.Format("mobileControlBridge-{0}", Key);
|
||||
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey);
|
||||
if (mcBridge == null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(destinationListKey))
|
||||
{
|
||||
DestinationListKey = destinationListKey;
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "*********************Mobile Control Bridge Not found for this room.");
|
||||
IsMobileControlEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If mobile control is enabled, sets the appropriate properties
|
||||
/// </summary>
|
||||
void SetUpMobileControl()
|
||||
else
|
||||
{
|
||||
var mcBridgeKey = string.Format("mobileControlBridge-{0}", Key);
|
||||
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey);
|
||||
if (mcBridge == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "*********************Mobile Control Bridge Not found for this room.");
|
||||
IsMobileControlEnabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MobileControlRoomBridge = mcBridge as IMobileControlRoomMessenger;
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "*********************Mobile Control Bridge found and enabled for this room");
|
||||
IsMobileControlEnabled = true;
|
||||
}
|
||||
MobileControlRoomBridge = mcBridge as IMobileControlRoomMessenger;
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "*********************Mobile Control Bridge found and enabled for this room");
|
||||
IsMobileControlEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
||||
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
||||
{
|
||||
switch (VacancyMode)
|
||||
{
|
||||
switch (VacancyMode)
|
||||
{
|
||||
case eVacancyMode.None:
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
case eVacancyMode.None:
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
break;
|
||||
case eVacancyMode.InInitialVacancy:
|
||||
StartRoomVacancyTimer(eVacancyMode.InShutdownWarning);
|
||||
break;
|
||||
case eVacancyMode.InShutdownWarning:
|
||||
{
|
||||
StartShutdown(eShutdownType.Vacancy);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Shutting Down due to vacancy.");
|
||||
break;
|
||||
case eVacancyMode.InInitialVacancy:
|
||||
StartRoomVacancyTimer(eVacancyMode.InShutdownWarning);
|
||||
break;
|
||||
case eVacancyMode.InShutdownWarning:
|
||||
{
|
||||
StartShutdown(eShutdownType.Vacancy);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Shutting Down due to vacancy.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <summary>
|
||||
/// StartShutdown method
|
||||
/// </summary>
|
||||
public void StartShutdown(eShutdownType type)
|
||||
{
|
||||
// Check for shutdowns running. Manual should override other shutdowns
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
public void StartShutdown(eShutdownType type)
|
||||
{
|
||||
// Check for shutdowns running. Manual should override other shutdowns
|
||||
|
||||
if (type == eShutdownType.Manual)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownPromptSeconds;
|
||||
else if (type == eShutdownType.Vacancy)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownVacancySeconds;
|
||||
ShutdownType = type;
|
||||
ShutdownPromptTimer.Start();
|
||||
if (type == eShutdownType.Manual)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownPromptSeconds;
|
||||
else if (type == eShutdownType.Vacancy)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownVacancySeconds;
|
||||
ShutdownType = type;
|
||||
ShutdownPromptTimer.Start();
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "ShutdownPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount);
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "ShutdownPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StartRoomVacancyTimer method
|
||||
/// </summary>
|
||||
public void StartRoomVacancyTimer(eVacancyMode mode)
|
||||
{
|
||||
if (mode == eVacancyMode.None)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownPromptSeconds;
|
||||
else if (mode == eVacancyMode.InInitialVacancy)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownSeconds;
|
||||
else if (mode == eVacancyMode.InShutdownWarning)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = 60;
|
||||
VacancyMode = mode;
|
||||
RoomVacancyShutdownTimer.Start();
|
||||
public void StartRoomVacancyTimer(eVacancyMode mode)
|
||||
{
|
||||
if (mode == eVacancyMode.None)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownPromptSeconds;
|
||||
else if (mode == eVacancyMode.InInitialVacancy)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownSeconds;
|
||||
else if (mode == eVacancyMode.InShutdownWarning)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = 60;
|
||||
VacancyMode = mode;
|
||||
RoomVacancyShutdownTimer.Start();
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Vacancy Timer Started. Mode: {0}. Seconds: {1}", VacancyMode, RoomVacancyShutdownTimer.SecondsToCount);
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Vacancy Timer Started. Mode: {0}. Seconds: {1}", VacancyMode, RoomVacancyShutdownTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shutdown method
|
||||
/// </summary>
|
||||
public void Shutdown()
|
||||
{
|
||||
VacancyMode = eVacancyMode.None;
|
||||
EndShutdown();
|
||||
}
|
||||
/// <summary>
|
||||
/// Resets the vacancy mode and shutsdwon the room
|
||||
/// </summary>
|
||||
public void Shutdown()
|
||||
{
|
||||
VacancyMode = eVacancyMode.None;
|
||||
EndShutdown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is for the derived class to define it's specific shutdown
|
||||
/// requirements but should not be called directly. It is called by Shutdown()
|
||||
/// </summary>
|
||||
protected abstract void EndShutdown();
|
||||
/// <summary>
|
||||
/// This method is for the derived class to define it's specific shutdown
|
||||
/// requirements but should not be called directly. It is called by Shutdown()
|
||||
/// </summary>
|
||||
protected abstract void EndShutdown();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override this to implement a default volume level(s) method
|
||||
/// </summary>
|
||||
public abstract void SetDefaultLevels();
|
||||
/// <summary>
|
||||
/// Override this to implement a default volume level(s) method
|
||||
/// </summary>
|
||||
public abstract void SetDefaultLevels();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the object to be used as the IOccupancyStatusProvider for the room. Can be an Occupancy Aggregator or a specific device
|
||||
/// </summary>
|
||||
/// <param name="statusProvider"></param>
|
||||
/// <param name="timeoutMinutes"></param>
|
||||
public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes)
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the object to be used as the IOccupancyStatusProvider for the room. Can be an Occupancy Aggregator or a specific device
|
||||
/// </summary>
|
||||
/// <param name="statusProvider"></param>
|
||||
public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes)
|
||||
{
|
||||
if (statusProvider == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Occupancy sensor device is null");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Timeout Minutes from Config is: {0}", timeoutMinutes);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Timeout Minutes from Config is: {0}", timeoutMinutes);
|
||||
|
||||
// If status provider is fusion, set flag to remote
|
||||
if (statusProvider is Core.Fusion.IEssentialsRoomFusionController)
|
||||
OccupancyStatusProviderIsRemote = true;
|
||||
// If status provider is fusion, set flag to remote
|
||||
if (statusProvider is Core.Fusion.IEssentialsRoomFusionController)
|
||||
OccupancyStatusProviderIsRemote = true;
|
||||
|
||||
if(timeoutMinutes > 0)
|
||||
RoomVacancyShutdownSeconds = timeoutMinutes * 60;
|
||||
if(timeoutMinutes > 0)
|
||||
RoomVacancyShutdownSeconds = timeoutMinutes * 60;
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "RoomVacancyShutdownSeconds set to {0}", RoomVacancyShutdownSeconds);
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "RoomVacancyShutdownSeconds set to {0}", RoomVacancyShutdownSeconds);
|
||||
|
||||
RoomOccupancy = statusProvider;
|
||||
RoomOccupancy = statusProvider;
|
||||
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange -= RoomIsOccupiedFeedback_OutputChange;
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange -= RoomIsOccupiedFeedback_OutputChange;
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
|
||||
|
||||
OnRoomOccupancyIsSet();
|
||||
}
|
||||
|
||||
void OnRoomOccupancyIsSet()
|
||||
{
|
||||
var handler = RoomOccupancyIsSet;
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to last source
|
||||
/// </summary>
|
||||
public abstract void PowerOnToDefaultOrLastSource();
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to default source
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract bool RunDefaultPresentRoute();
|
||||
|
||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false && AllowVacancyTimerToStart())
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Notice: Vacancy Detected");
|
||||
// Trigger the timer when the room is vacant
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Notice: Occupancy Detected");
|
||||
// Reset the timer when the room is occupied
|
||||
RoomVacancyShutdownTimer.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
||||
|
||||
/// <summary>
|
||||
/// Allow the vacancy event from an occupancy sensor to turn the room off.
|
||||
/// </summary>
|
||||
/// <returns>If the timer should be allowed. Defaults to true</returns>
|
||||
protected virtual bool AllowVacancyTimerToStart()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
OnRoomOccupancyIsSet();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To describe the various ways a room may be shutting down
|
||||
/// </summary>
|
||||
public enum eShutdownType
|
||||
|
||||
void OnRoomOccupancyIsSet()
|
||||
{
|
||||
/// <summary>
|
||||
/// No shutdown in progress
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Manual shutdown initiated
|
||||
/// </summary>
|
||||
External,
|
||||
|
||||
/// <summary>
|
||||
/// Vacancy based shutdown
|
||||
/// </summary>
|
||||
Manual,
|
||||
|
||||
/// <summary>
|
||||
/// Shutdown due to room vacancy
|
||||
/// </summary>
|
||||
Vacancy
|
||||
var handler = RoomOccupancyIsSet;
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration of eVacancyMode values
|
||||
/// To allow base class to power room on to last source
|
||||
/// </summary>
|
||||
public enum eVacancyMode
|
||||
{
|
||||
/// <summary>
|
||||
/// No vacancy detected
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// InInitialVacancy - countdown to warning
|
||||
/// </summary>
|
||||
InInitialVacancy,
|
||||
|
||||
/// <summary>
|
||||
/// InShutdownWarning - countdown to shutdown
|
||||
/// </summary>
|
||||
InShutdownWarning
|
||||
}
|
||||
public abstract void PowerOnToDefaultOrLastSource();
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration of eWarmingCoolingMode values
|
||||
/// To allow base class to power room on to default source
|
||||
/// </summary>
|
||||
public enum eWarmingCoolingMode
|
||||
/// <returns></returns>
|
||||
public abstract bool RunDefaultPresentRoute();
|
||||
|
||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
/// <summary>
|
||||
/// None
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Warming
|
||||
/// </summary>
|
||||
Warming,
|
||||
|
||||
/// <summary>
|
||||
/// Cooling
|
||||
/// </summary>
|
||||
Cooling
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for room emergency implementations
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomEmergencyBase : IKeyed
|
||||
{
|
||||
/// <summary>
|
||||
/// Key of the room
|
||||
/// </summary>
|
||||
public string Key { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for EssentialsRoomEmergencyBase
|
||||
/// </summary>
|
||||
/// <param name="key">key of the room</param>
|
||||
public EssentialsRoomEmergencyBase(string key)
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false && AllowVacancyTimerToStart())
|
||||
{
|
||||
Key = key;
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Notice: Vacancy Detected");
|
||||
// Trigger the timer when the room is vacant
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Notice: Occupancy Detected");
|
||||
// Reset the timer when the room is occupied
|
||||
RoomVacancyShutdownTimer.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
||||
|
||||
/// <summary>
|
||||
/// Allow the vacancy event from an occupancy sensor to turn the room off.
|
||||
/// </summary>
|
||||
/// <returns>If the timer should be allowed. Defaults to true</returns>
|
||||
protected virtual bool AllowVacancyTimerToStart()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To describe the various ways a room may be shutting down
|
||||
/// </summary>
|
||||
public enum eShutdownType
|
||||
{
|
||||
None = 0,
|
||||
External,
|
||||
Manual,
|
||||
Vacancy
|
||||
}
|
||||
|
||||
public enum eVacancyMode
|
||||
{
|
||||
None = 0,
|
||||
InInitialVacancy,
|
||||
InShutdownWarning
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eWarmingCoolingMode
|
||||
{
|
||||
None,
|
||||
Warming,
|
||||
Cooling
|
||||
}
|
||||
|
||||
public abstract class EssentialsRoomEmergencyBase : IKeyed
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
|
||||
public EssentialsRoomEmergencyBase(string key)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
}
|
||||
|
|
@ -10,103 +10,101 @@ using PepperDash.Essentials.Core.Devices;
|
|||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Describes the basic functionality of an EssentialsRoom
|
||||
/// </summary>
|
||||
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute, IEnvironmentalControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the basic functionality of an EssentialsRoom
|
||||
/// Gets the PowerFeedback
|
||||
/// </summary>
|
||||
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute, IEnvironmentalControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the PowerFeedback
|
||||
/// </summary>
|
||||
BoolFeedback OnFeedback { get; }
|
||||
BoolFeedback OnFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IsOccupiedFeedback
|
||||
/// </summary>
|
||||
BoolFeedback IsWarmingUpFeedback { get; }
|
||||
/// <summary>
|
||||
/// Gets the IsOccupiedFeedback
|
||||
/// </summary>
|
||||
BoolFeedback IsWarmingUpFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IsCoolingDownFeedback
|
||||
/// </summary>
|
||||
BoolFeedback IsCoolingDownFeedback { get; }
|
||||
/// <summary>
|
||||
/// Gets the IsCoolingDownFeedback
|
||||
/// </summary>
|
||||
BoolFeedback IsCoolingDownFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether mobile control is enabled for this room
|
||||
/// </summary>
|
||||
bool IsMobileControlEnabled { get; }
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether mobile control is enabled for this room
|
||||
/// </summary>
|
||||
bool IsMobileControlEnabled { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MobileControlRoomBridge
|
||||
/// </summary>
|
||||
IMobileControlRoomMessenger MobileControlRoomBridge { get; }
|
||||
/// <summary>
|
||||
/// Gets the MobileControlRoomBridge
|
||||
/// </summary>
|
||||
IMobileControlRoomMessenger MobileControlRoomBridge { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the SourceListKey
|
||||
/// </summary>
|
||||
string SourceListKey { get; }
|
||||
/// <summary>
|
||||
/// Gets the SourceListKey
|
||||
/// </summary>
|
||||
string SourceListKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the DestinationListKey
|
||||
/// </summary>
|
||||
string DestinationListKey { get; }
|
||||
/// <summary>
|
||||
/// Gets the DestinationListKey
|
||||
/// </summary>
|
||||
string DestinationListKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the AudioControlPointListKey
|
||||
/// </summary>
|
||||
string AudioControlPointListKey { get; }
|
||||
/// <summary>
|
||||
/// Gets the AudioControlPointListKey
|
||||
/// </summary>
|
||||
string AudioControlPointListKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the CameraListKey
|
||||
/// </summary>
|
||||
string CameraListKey { get; }
|
||||
/// <summary>
|
||||
/// Gets the CameraListKey
|
||||
/// </summary>
|
||||
string CameraListKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ShutdownPromptTimer
|
||||
/// </summary>
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
/// <summary>
|
||||
/// Gets the ShutdownPromptTimer
|
||||
/// </summary>
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ShutdownVacancyTimer
|
||||
/// </summary>
|
||||
int ShutdownPromptSeconds { get; }
|
||||
/// <summary>
|
||||
/// Gets the ShutdownVacancyTimer
|
||||
/// </summary>
|
||||
int ShutdownPromptSeconds { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ShutdownVacancySeconds
|
||||
/// </summary>
|
||||
int ShutdownVacancySeconds { get; }
|
||||
/// <summary>
|
||||
/// Gets the ShutdownVacancySeconds
|
||||
/// </summary>
|
||||
int ShutdownVacancySeconds { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ShutdownType
|
||||
/// </summary>
|
||||
eShutdownType ShutdownType { get; }
|
||||
/// <summary>
|
||||
/// Gets the ShutdownType
|
||||
/// </summary>
|
||||
eShutdownType ShutdownType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the LogoUrlLightBkgnd
|
||||
/// </summary>
|
||||
string LogoUrlLightBkgnd { get; }
|
||||
/// <summary>
|
||||
/// Gets the LogoUrlLightBkgnd
|
||||
/// </summary>
|
||||
string LogoUrlLightBkgnd { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the LogoUrlDarkBkgnd
|
||||
/// </summary>
|
||||
string LogoUrlDarkBkgnd { get; }
|
||||
/// <summary>
|
||||
/// Gets the LogoUrlDarkBkgnd
|
||||
/// </summary>
|
||||
string LogoUrlDarkBkgnd { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Starts the shutdown process
|
||||
/// </summary>
|
||||
/// <param name="type">type of shutdown event</param>
|
||||
void StartShutdown(eShutdownType type);
|
||||
/// <summary>
|
||||
/// Starts the shutdown process
|
||||
/// </summary>
|
||||
/// <param name="type">type of shutdown event</param>
|
||||
void StartShutdown(eShutdownType type);
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the room
|
||||
/// </summary>
|
||||
void Shutdown();
|
||||
/// <summary>
|
||||
/// Shuts down the room
|
||||
/// </summary>
|
||||
void Shutdown();
|
||||
|
||||
/// <summary>
|
||||
/// Powers on the room to either the default source or the last source used
|
||||
/// </summary>
|
||||
void PowerOnToDefaultOrLastSource();
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Powers on the room to either the default source or the last source used
|
||||
/// </summary>
|
||||
void PowerOnToDefaultOrLastSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,39 +2,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IRoomEventSchedule
|
||||
/// </summary>
|
||||
public interface IRoomEventSchedule
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for IRoomEventSchedule
|
||||
/// Adds or updates a scheduled event
|
||||
/// </summary>
|
||||
public interface IRoomEventSchedule
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds or updates a scheduled event
|
||||
/// </summary>
|
||||
/// <param name="eventConfig"></param>
|
||||
void AddOrUpdateScheduledEvent(ScheduledEventConfig eventConfig);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a scheduled event by its key
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<ScheduledEventConfig> GetScheduledEvents();
|
||||
|
||||
/// <summary>
|
||||
/// Removes a scheduled event by its key
|
||||
/// </summary>
|
||||
event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||
}
|
||||
/// <param name="eventConfig"></param>
|
||||
void AddOrUpdateScheduledEvent(ScheduledEventConfig eventConfig);
|
||||
|
||||
/// <summary>
|
||||
/// Represents a ScheduledEventEventArgs
|
||||
/// Removes a scheduled event by its key
|
||||
/// </summary>
|
||||
public class ScheduledEventEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ScheduledEvents
|
||||
/// </summary>
|
||||
public List<ScheduledEventConfig> ScheduledEvents;
|
||||
}
|
||||
/// <returns></returns>
|
||||
List<ScheduledEventConfig> GetScheduledEvents();
|
||||
|
||||
/// <summary>
|
||||
/// Removes a scheduled event by its key
|
||||
/// </summary>
|
||||
event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a ScheduledEventEventArgs
|
||||
/// </summary>
|
||||
public class ScheduledEventEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ScheduledEvents
|
||||
/// </summary>
|
||||
public List<ScheduledEventConfig> ScheduledEvents;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,307 +4,308 @@ using System.Collections.Generic;
|
|||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with in call feedback
|
||||
/// </summary>
|
||||
public interface IHasInCallFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// For rooms with in call feedback
|
||||
/// Feedback indicating whether the room is currently in a call
|
||||
/// </summary>
|
||||
public interface IHasInCallFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the InCallFeedback
|
||||
/// </summary>
|
||||
BoolFeedback InCallFeedback { get; }
|
||||
}
|
||||
BoolFeedback InCallFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with a single display
|
||||
/// </summary>
|
||||
public interface IHasDefaultDisplay
|
||||
{
|
||||
/// <summary>
|
||||
/// The default display for the room, used for presentation routing and other default routes
|
||||
/// </summary>
|
||||
IRoutingSink DefaultDisplay { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with multiple displays
|
||||
/// </summary>
|
||||
[Obsolete("This interface is being deprecated in favor of using destination lists for routing to multiple displays.")]
|
||||
public interface IHasMultipleDisplays
|
||||
{
|
||||
/// <summary>
|
||||
/// A dictionary of displays in the room with the key being the type of display (presentation, calling, etc.) and the value being the display device
|
||||
/// </summary>
|
||||
Dictionary<eSourceListItemDestinationTypes, IRoutingSink> Displays { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a route action for a given route and source list key.
|
||||
/// The source list key is used to determine the source for the route from the source list in the room's routing controller.
|
||||
/// This allows for dynamic routing based on what source is selected in the UI for a given route.
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="sourceListKey"></param>
|
||||
void RunRouteAction(string routeKey, string sourceListKey);
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with a single display
|
||||
/// Runs a route action for a given route and source list key with a callback for success.
|
||||
/// The source list key is used to determine the source for the route from the source list in the room's routing controller.
|
||||
/// This allows for dynamic routing based on what source is selected in the UI for a given route.
|
||||
/// </summary>
|
||||
public interface IHasDefaultDisplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the DefaultDisplay
|
||||
/// </summary>
|
||||
IRoutingSink DefaultDisplay { get; }
|
||||
}
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="sourceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
void RunRouteAction(string routeKey, string sourceListKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simplified routing direct from source to destination
|
||||
/// </summary>
|
||||
public interface IRunDirectRouteAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a direct route from a source to a destination with an optional signal type for routing.
|
||||
/// </summary>
|
||||
/// <param name="sourceKey"></param>
|
||||
/// <param name="destinationKey"></param>
|
||||
/// <param name="type"></param>
|
||||
void RunDirectRoute(string sourceKey, string destinationKey, eRoutingSignalType type = eRoutingSignalType.AudioVideo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with matrix routing
|
||||
/// </summary>
|
||||
public interface IHasMatrixRouting : IHasRoutingEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the matrix routing device in the room
|
||||
/// </summary>
|
||||
string MatrixRoutingDeviceKey { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with routing endpoints
|
||||
/// </summary>
|
||||
public interface IHasRoutingEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// The keys of the endpoints in the room used for routing
|
||||
/// </summary>
|
||||
List<string> EndpointKeys { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with a shutdown prompt timer
|
||||
/// </summary>
|
||||
public interface IShutdownPromptTimer
|
||||
{
|
||||
/// <summary>
|
||||
/// The shutdown prompt timer for the room
|
||||
/// </summary>
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with multiple displays
|
||||
/// Sets the number of seconds for the shutdown prompt timer
|
||||
/// </summary>
|
||||
[Obsolete("Will be removed in a future version")]
|
||||
public interface IHasMultipleDisplays
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Displays dictionary
|
||||
/// </summary>
|
||||
Dictionary<eSourceListItemDestinationTypes, IRoutingSink> Displays { get; }
|
||||
}
|
||||
/// <param name="seconds"></param>
|
||||
void SetShutdownPromptSeconds(int seconds);
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// Starts the shutdown process for the room with a given shutdown type
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a route action
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="sourceListKey"></param>
|
||||
void RunRouteAction(string routeKey, string sourceListKey);
|
||||
/// <param name="type"></param>
|
||||
void StartShutdown(eShutdownType type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a route action with a success callback
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="sourceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
void RunRouteAction(string routeKey, string sourceListKey, Action successCallback);
|
||||
}
|
||||
/// <summary>
|
||||
/// Describes a room with a tech password
|
||||
/// </summary>
|
||||
public interface ITechPassword
|
||||
{
|
||||
/// <summary>
|
||||
/// Event that fires with the result of validating a tech password
|
||||
/// </summary>
|
||||
event EventHandler<TechPasswordEventArgs> TechPasswordValidateResult;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IRunDirectRouteAction
|
||||
/// Event that fires when the tech password is changed
|
||||
/// </summary>
|
||||
public interface IRunDirectRouteAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a direct route
|
||||
/// </summary>
|
||||
/// <param name="sourceKey"></param>
|
||||
/// <param name="destinationKey"></param>
|
||||
/// <param name="type"></param>
|
||||
void RunDirectRoute(string sourceKey, string destinationKey, eRoutingSignalType type = eRoutingSignalType.AudioVideo);
|
||||
}
|
||||
event EventHandler<EventArgs> TechPasswordChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with matrix routing
|
||||
/// The length of the tech password
|
||||
/// </summary>
|
||||
public interface IHasMatrixRouting
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the MatrixRoutingDeviceKey
|
||||
/// </summary>
|
||||
string MatrixRoutingDeviceKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the EndpointKeys
|
||||
/// </summary>
|
||||
List<string> EndpointKeys { get; }
|
||||
}
|
||||
int TechPasswordLength { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IHasRoutingEndpoints
|
||||
/// Validates a given tech password against the current tech password for the room. Fires the TechPasswordValidateResult event with the result of the validation.
|
||||
/// </summary>
|
||||
public interface IHasRoutingEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the EndpointKeys
|
||||
/// </summary>
|
||||
List<string> EndpointKeys { get; }
|
||||
}
|
||||
/// <param name="password"></param>
|
||||
void ValidateTechPassword(string password);
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with a shutdown prompt timer
|
||||
/// Sets a new tech password for the room. Fires the TechPasswordChanged event when the password is successfully changed.
|
||||
/// </summary>
|
||||
public interface IShutdownPromptTimer
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the ShutdownPromptTimer
|
||||
/// </summary>
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
/// <param name="oldPassword"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
void SetTechPassword(string oldPassword, string newPassword);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ShutdownPromptSeconds
|
||||
/// </summary>
|
||||
/// <param name="seconds">number of seconds to set</param>
|
||||
void SetShutdownPromptSeconds(int seconds);
|
||||
|
||||
/// <summary>
|
||||
/// Starts the shutdown process
|
||||
/// </summary>
|
||||
/// <param name="type">type of shutdown event</param>
|
||||
void StartShutdown(eShutdownType type);
|
||||
}
|
||||
/// <summary>
|
||||
/// Event args for tech password validation results
|
||||
/// </summary>
|
||||
public class TechPasswordEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the tech password validation was successful or not
|
||||
/// </summary>
|
||||
public bool IsValid { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for ITechPassword
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public interface ITechPassword
|
||||
/// <param name="isValid"></param>
|
||||
public TechPasswordEventArgs(bool isValid)
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when tech password validation result is available
|
||||
/// </summary>
|
||||
event EventHandler<TechPasswordEventArgs> TechPasswordValidateResult;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when tech password is changed
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> TechPasswordChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the TechPasswordLength
|
||||
/// </summary>
|
||||
int TechPasswordLength { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Validates the tech password
|
||||
/// </summary>
|
||||
/// <param name="password">The tech password to validate</param>
|
||||
void ValidateTechPassword(string password);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the tech password
|
||||
/// </summary>
|
||||
/// <param name="oldPassword">The current tech password</param>
|
||||
/// <param name="newPassword">The new tech password to set</param>
|
||||
void SetTechPassword(string oldPassword, string newPassword);
|
||||
IsValid = isValid;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs the default presentation route for the room. This is typically used for a "Present" button in the UI that routes a selected source to the default presentation display without needing to specify the source or destination for the route.
|
||||
/// </summary>
|
||||
/// <returns>True if the route was successfully run, false otherwise.</returns>
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs the default call route for the room. This is typically used for a "Call" button in the UI that routes a selected source to the default call display without needing to specify the source or destination for the route.
|
||||
/// </summary>
|
||||
/// <returns>True if the route was successfully run, false otherwise.</returns>
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes environmental controls available on a room such as lighting, shades, temperature, etc.
|
||||
/// </summary>
|
||||
public interface IEnvironmentalControls
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of devices in the room that can be used for environmental control such as lighting, shades, temperature, etc.
|
||||
/// </summary>
|
||||
List<EssentialsDevice> EnvironmentalControlDevices { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a TechPasswordEventArgs
|
||||
/// Indicates whether the room has any devices that can be used for environmental control such as lighting, shades, temperature, etc.
|
||||
/// </summary>
|
||||
public class TechPasswordEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the IsValid
|
||||
/// </summary>
|
||||
public bool IsValid { get; private set; }
|
||||
bool HasEnvironmentalControlDevices { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for TechPasswordEventArgs
|
||||
/// </summary>
|
||||
/// <param name="isValid"></param>
|
||||
public TechPasswordEventArgs(bool isValid)
|
||||
{
|
||||
IsValid = isValid;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Describes a room with occupancy status
|
||||
/// </summary>
|
||||
public interface IRoomOccupancy:IKeyed
|
||||
{
|
||||
/// <summary>
|
||||
/// The occupancy status provider for the room, which provides the current occupancy status of the room based on a sensor or other input.
|
||||
/// This is used for features such as automatic shutdown when the room is vacant, adjusting environmental controls based on occupancy, and other occupancy-based automation.
|
||||
/// </summary>
|
||||
IOccupancyStatusProvider RoomOccupancy { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IRunDefaultPresentRoute
|
||||
/// Indicates whether the occupancy status provider for the room is remote, meaning it is not directly connected to the control system and may require additional setup or configuration to work properly.
|
||||
/// This can be used to determine whether certain features that rely on occupancy status should be enabled or disabled for the room.
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs the default present route
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
bool OccupancyStatusProviderIsRemote { get; }
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// Sets the occupancy status provider for the room with a given timeout period for determining when the room is vacant. T
|
||||
/// his is used to configure the occupancy-based features of the room based on the specific occupancy sensor or input being used and the desired timeout period for determining vacancy.
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs the default call route
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
/// <param name="statusProvider"></param>
|
||||
/// <param name="timeoutMinutes"></param>
|
||||
void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes);
|
||||
|
||||
/// <summary>
|
||||
/// Describes environmental controls available on a room such as lighting, shades, temperature, etc.
|
||||
/// Event handler for when the room is vacated for the timeout period, which can be used to trigger actions such as shutting down the room, adjusting environmental controls, or other automation based on vacancy.
|
||||
/// </summary>
|
||||
public interface IEnvironmentalControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the EnvironmentalControlDevices
|
||||
/// </summary>
|
||||
List<EssentialsDevice> EnvironmentalControlDevices { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the room has environmental control devices
|
||||
/// </summary>
|
||||
bool HasEnvironmentalControlDevices { get; }
|
||||
}
|
||||
/// <param name="o"></param>
|
||||
void RoomVacatedForTimeoutPeriod(object o);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IRoomOccupancy
|
||||
/// Starts the timer for determining when the room is vacant based on the specified vacancy mode, which can be used to trigger actions such as shutting down the room, adjusting environmental controls, or other automation based on vacancy.
|
||||
/// </summary>
|
||||
public interface IRoomOccupancy : IKeyed
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the RoomOccupancy
|
||||
/// </summary>
|
||||
IOccupancyStatusProvider RoomOccupancy { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the OccupancyStatusProviderIsRemote
|
||||
/// </summary>
|
||||
bool OccupancyStatusProviderIsRemote { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the room occupancy
|
||||
/// </summary>
|
||||
/// <param name="statusProvider"></param>
|
||||
/// <param name="timeoutMinutes"></param>
|
||||
void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes);
|
||||
|
||||
/// <summary>
|
||||
/// Called when the room has been vacated for the timeout period
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
void RoomVacatedForTimeoutPeriod(object o);
|
||||
|
||||
/// <summary>
|
||||
/// Starts the room vacancy timer
|
||||
/// </summary>
|
||||
/// <param name="mode">vacancy mode</param>
|
||||
void StartRoomVacancyTimer(eVacancyMode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the VacancyMode
|
||||
/// </summary>
|
||||
eVacancyMode VacancyMode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when room occupancy is set
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
}
|
||||
/// <param name="mode"></param>
|
||||
void StartRoomVacancyTimer(eVacancyMode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IEmergency
|
||||
/// Gets the current vacancy mode for the room, which indicates the current state of the room in terms of occupancy and can be used to determine whether certain features or automation should be enabled or disabled based on vacancy.
|
||||
/// </summary>
|
||||
public interface IEmergency
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Emergency
|
||||
/// </summary>
|
||||
EssentialsRoomEmergencyBase Emergency { get; }
|
||||
}
|
||||
eVacancyMode VacancyMode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IMicrophonePrivacy
|
||||
/// Event that fires when the occupancy status for the room is set, which can be used to trigger actions such as updating the UI, adjusting environmental controls, or other automation based on occupancy status changes.
|
||||
/// </summary>
|
||||
public interface IMicrophonePrivacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the MicrophonePrivacy
|
||||
/// </summary>
|
||||
Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; }
|
||||
}
|
||||
event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with emergency features
|
||||
/// </summary>
|
||||
public interface IEmergency
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for IHasAccessoryDevices
|
||||
/// The emergency base for the room, which provides access to emergency features such as triggering an emergency alert, contacting emergency services, or other emergency-related functionality.
|
||||
/// </summary>
|
||||
public interface IHasAccessoryDevices : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the AccessoryDeviceKeys
|
||||
/// </summary>
|
||||
List<string> AccessoryDeviceKeys { get; }
|
||||
}
|
||||
EssentialsRoomEmergencyBase Emergency { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with a microphone privacy controller
|
||||
/// </summary>
|
||||
public interface IMicrophonePrivacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for IHasCiscoNavigatorTouchpanel
|
||||
/// The microphone privacy controller for the room, which provides access to features such as muting or unmuting microphones for privacy purposes.
|
||||
/// </summary>
|
||||
public interface IHasCiscoNavigatorTouchpanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the CiscoNavigatorTouchpanelKey
|
||||
/// </summary>
|
||||
string CiscoNavigatorTouchpanelKey { get; }
|
||||
}
|
||||
Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with a camera privacy controller
|
||||
/// </summary>
|
||||
public interface IHasAccessoryDevices : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of keys for accessory devices in the room such as cameras, microphones, or other devices that are not part of the main control system but can be integrated for additional functionality.
|
||||
/// </summary>
|
||||
List<string> AccessoryDeviceKeys { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room wih a Cisco Navigator touchpanel
|
||||
/// </summary>
|
||||
public interface IHasCiscoNavigatorTouchpanel
|
||||
{
|
||||
/// <summary>
|
||||
/// The key for the Cisco Navigator touchpanel in the room, which can be used to route calls or content to the touchpanel or for other integration purposes.
|
||||
/// </summary>
|
||||
string CiscoNavigatorTouchpanelKey { get; }
|
||||
}
|
||||
|
|
@ -8,8 +8,8 @@ using Crestron.SimplSharpPro;
|
|||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
//***************************************************************************************************
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -87,15 +87,14 @@ namespace PepperDash.Essentials.Core
|
|||
{
|
||||
get
|
||||
{
|
||||
return new FeedbackCollection<Feedback>
|
||||
{
|
||||
RoomIsOnFeedback,
|
||||
IsCoolingDownFeedback,
|
||||
IsWarmingUpFeedback
|
||||
};
|
||||
return new FeedbackCollection<Feedback>
|
||||
{
|
||||
RoomIsOnFeedback,
|
||||
IsCoolingDownFeedback,
|
||||
IsWarmingUpFeedback
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,16 +6,16 @@ using Crestron.SimplSharp;
|
|||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for IOccupancyStatusProvider
|
||||
/// </summary>
|
||||
public interface IOccupancyStatusProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for IOccupancyStatusProvider
|
||||
/// Gets the RoomIsOccupiedFeedback
|
||||
/// </summary>
|
||||
public interface IOccupancyStatusProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the RoomIsOccupiedFeedback
|
||||
/// </summary>
|
||||
BoolFeedback RoomIsOccupiedFeedback { get; }
|
||||
}
|
||||
}
|
||||
BoolFeedback RoomIsOccupiedFeedback { get; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue