mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +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:
@@ -1,10 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Lighting
|
namespace PepperDash.Essentials.Core.Lighting
|
||||||
{
|
{
|
||||||
@@ -23,6 +18,11 @@ namespace PepperDash.Essentials.Core.Lighting
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface ILightingScenesDynamic
|
||||||
|
{
|
||||||
|
event EventHandler LightingScenesUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Requirements for a device that implements master raise/lower
|
/// Requirements for a device that implements master raise/lower
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ namespace PepperDash.Essentials.Core.Lighting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public int SortOrder { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public BoolFeedback IsActiveFeedback { get; set; }
|
public BoolFeedback IsActiveFeedback { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
{
|
{
|
||||||
Device = device ?? throw new ArgumentNullException("device");
|
Device = device ?? throw new ArgumentNullException("device");
|
||||||
Device.LightingSceneChange += new EventHandler<LightingSceneChangeEventArgs>(LightingDevice_LightingSceneChange);
|
Device.LightingSceneChange += new EventHandler<LightingSceneChangeEventArgs>(LightingDevice_LightingSceneChange);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LightingDevice_LightingSceneChange(object sender, LightingSceneChangeEventArgs e)
|
private void LightingDevice_LightingSceneChange(object sender, LightingSceneChangeEventArgs e)
|
||||||
@@ -40,6 +38,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
var s = content.ToObject<LightingScene>();
|
var s = content.ToObject<LightingScene>();
|
||||||
Device.SelectScene(s);
|
Device.SelectScene(s);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(!(Device is ILightingScenesDynamic lightingScenesDynamic))
|
||||||
|
return;
|
||||||
|
|
||||||
|
lightingScenesDynamic.LightingScenesUpdated += (s, e) => SendFullStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user