fix: update lighting interfaces & messenger

Added the `ILightingScenesDynamic` interface to add an event for devices that support retrieving scene data from the lighting system at runtime. Also added the `sortOrder` property for the `LightingScene` type to allow for control over the sort order of scenes on the UI
This commit is contained in:
Andrew Welker
2025-04-14 10:45:43 -05:00
parent d8c7e3cfc7
commit e86ab8fa8b
3 changed files with 13 additions and 7 deletions

View File

@@ -15,8 +15,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
{
Device = device ?? throw new ArgumentNullException("device");
Device.LightingSceneChange += new EventHandler<LightingSceneChangeEventArgs>(LightingDevice_LightingSceneChange);
}
private void LightingDevice_LightingSceneChange(object sender, LightingSceneChangeEventArgs e)
@@ -40,6 +38,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
var s = content.ToObject<LightingScene>();
Device.SelectScene(s);
});
if(!(Device is ILightingScenesDynamic lightingScenesDynamic))
return;
lightingScenesDynamic.LightingScenesUpdated += (s, e) => SendFullStatus();
}