Skip to content

Commit

Permalink
fix: Adds new property to EssentialsRoomBase and implements consisten…
Browse files Browse the repository at this point in the history
…t default key if no key set
  • Loading branch information
ndorin committed May 17, 2024
1 parent 7942c91 commit 0067e11
Showing 1 changed file with 61 additions and 8 deletions.
69 changes: 61 additions & 8 deletions src/PepperDash.Essentials.Core/Room/EssentialsRoomBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,81 @@ public bool HasEnvironmentalControlDevices
/// </summary>
public IMobileControlRoomMessenger MobileControlRoomBridge { get; private set; }

protected const string _defaultListKey = "default";

/// <summary>
/// The config name of the source list
/// </summary>
///
protected string _SourceListKey;
private string _sourceListKey;
public string SourceListKey {
get
{
return _SourceListKey;
if(string.IsNullOrEmpty(_sourceListKey))
{
return _defaultListKey;
}
else
{
return _sourceListKey;
}
}
private set
protected set
{
if (value != _SourceListKey)
if (value != _sourceListKey)
{
_SourceListKey = value;
_sourceListKey = value;
}
}
}

public string DestinationListKey { get; private set; }
private string _destinationListKey;
public string DestinationListKey
{
get
{
if (string.IsNullOrEmpty(_destinationListKey))
{
return _defaultListKey;
}
else
{
return _destinationListKey;
}
}
protected set
{
if (value != _destinationListKey)
{
_destinationListKey = value;
}
}
}

private string _levelControlListKey;
public string LevelControlListKey
{
get
{
if (string.IsNullOrEmpty(_levelControlListKey))
{
return _defaultListKey;
}
else
{
return _destinationListKey;
}
}
protected set
{
if (value != _levelControlListKey)
{
_levelControlListKey = value;
}
}
}


protected const string _defaultSourceListKey = "default";

/// <summary>
/// Timer used for informing the UIs of a shutdown
Expand Down Expand Up @@ -192,7 +245,7 @@ protected void SetSourceListKey(string sourceListKey)
}
else
{
sourceListKey = _defaultSourceListKey;
sourceListKey = _defaultListKey;
}
}

Expand Down

0 comments on commit 0067e11

Please sign in to comment.