Skip to content

Commit

Permalink
feat: adds deviceKey property to LevelControlListItem to synthesize d…
Browse files Browse the repository at this point in the history
…evice key
  • Loading branch information
ndorin committed May 22, 2024
1 parent 2f9038a commit 621d848
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public string PreferredName
}
}

/// <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>
Expand Down

0 comments on commit 621d848

Please sign in to comment.