mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 04:04:58 +00:00
Add DestinationLists to config
This commit is contained in:
@@ -1,11 +1,6 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
@@ -25,7 +20,10 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
[JsonProperty("sourceLists")]
|
[JsonProperty("sourceLists")]
|
||||||
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
||||||
|
|
||||||
[JsonProperty("tieLines")]
|
[JsonProperty("destinationLists")]
|
||||||
|
public Dictionary<string, Dictionary<string,DestinationListItem>> DestinationLists { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("tieLines")]
|
||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
[JsonProperty("joinMaps")]
|
[JsonProperty("joinMaps")]
|
||||||
@@ -42,6 +40,16 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
return SourceLists[key];
|
return SourceLists[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DestinationLists[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