From 84080933445c98bb2a2ffd88d6eec719a8488e41 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 24 Jun 2020 16:39:25 -0600 Subject: [PATCH] update config with DestinationList --- .../Devices/DestinationListItem.cs | 41 +++++++++++++++---- .../PepperDash_Essentials_Core.csproj | 1 + 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs index 56af8d6c..92ca3a76 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs @@ -1,23 +1,50 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Newtonsoft.Json; +using Newtonsoft.Json; using PepperDash.Essentials.Core; namespace PepperDash_Essentials_Core.Devices { public class DestinationListItem { - [JsonProperty("sinkYey")] + [JsonProperty("sinkKey")] public string SinkKey { get; set; } private EssentialsDevice _sinkDevice; + [JsonIgnore] public EssentialsDevice SinkDevice { get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); } } + + public string PreferredName + { + get + { + if (!string.IsNullOrEmpty(Name)) + { + return Name; + } + + return SinkDevice == null ? "---" : SinkDevice.Name; + } + } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("includeInDestinationList")] + public bool IncludeInDestinationList { get; set; } + + [JsonProperty("order")] + public int Order { get; set; } + + [JsonProperty("surfaceLocation")] + public int SurfaceLocation { get; set; } + + [JsonProperty("verticalLocation")] + public int VerticalLocation { get; set; } + + [JsonProperty("horizontalLocation")] + public int HorizontalLocation { get; set; } } } \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index 55a157b4..aa300de2 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -181,6 +181,7 @@ +