mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-05 15:55:02 +00:00
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
40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
|
|
|
|
using System;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace PepperDash.Essentials.Core.Lighting
|
|
{
|
|
public class LightingScene
|
|
{
|
|
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
|
public string Name { get; set; }
|
|
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
|
public string ID { get; set; }
|
|
bool _IsActive;
|
|
[JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)]
|
|
public bool IsActive
|
|
{
|
|
get
|
|
{
|
|
return _IsActive;
|
|
}
|
|
set
|
|
{
|
|
_IsActive = value;
|
|
IsActiveFeedback.FireUpdate();
|
|
}
|
|
}
|
|
|
|
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
|
|
public int SortOrder { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public BoolFeedback IsActiveFeedback { get; set; }
|
|
|
|
public LightingScene()
|
|
{
|
|
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));
|
|
}
|
|
}
|
|
} |