feat: adds deviceKey property to LevelControlListItem to synthesize device key

This commit is contained in:
Neil Dorin
2024-05-22 14:53:01 -06:00
parent 2f9038a501
commit 621d848418

View File

@@ -47,6 +47,13 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// The key of the device in the DeviceManager for control
/// </summary>
[JsonProperty("deviceKey")]
public string DeviceKey => DeviceManager.AllDevices.
Where(d => d.Key.Contains(ParentDeviceKey) && d.Key.Contains(ItemKey)).FirstOrDefault()?.Key ?? $"{ParentDeviceKey}--{ItemKey}";
/// <summary>
/// Indicates if the item is a level, mute , or both
/// </summary>