mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
feat: Adds helper method for getting LevelControlList by key
This commit is contained in:
@@ -58,8 +58,8 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a DestinationListItem based on the key
|
/// Retrieves a DestinationListItem based on the key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">key of the item to retrieve</param>
|
/// <param name="key">key of the list to retrieve</param>
|
||||||
/// <returns>DestinationListItem if the key exists, null otherwise</returns>
|
/// <returns>DestinationList if the key exists, null otherwise</returns>
|
||||||
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
|
if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
|
||||||
@@ -70,6 +70,19 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
return DestinationLists[key];
|
return DestinationLists[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a LevelControlList based on the key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the list to retrieve</param>
|
||||||
|
/// <returns>LevelControlList if the key exists, null otherwise</returns>
|
||||||
|
public Dictionary<string, LevelControlListItem> GetLevelControlListForKey(string key)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(key) || !LevelControlLists.ContainsKey(key))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return LevelControlLists[key];
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user