mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-08 17:24:47 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user