mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
feat(essentials): Adds IEnvironmentalControls interface and updates some room config properties
This commit is contained in:
@@ -147,6 +147,24 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
[JsonProperty("helpMessage")]
|
[JsonProperty("helpMessage")]
|
||||||
public string HelpMessage { get; set; }
|
public string HelpMessage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Read this value to get the help message. It checks for the old and new config format.
|
||||||
|
/// </summary>
|
||||||
|
public string HelpMessageForDisplay
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if(Help != null && !string.IsNullOrEmpty(Help.Message))
|
||||||
|
{
|
||||||
|
return Help.Message;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return HelpMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[JsonProperty("environment")]
|
[JsonProperty("environment")]
|
||||||
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ using PepperDash.Essentials.Core.Config;
|
|||||||
using PepperDash.Essentials.Core.Devices;
|
using PepperDash.Essentials.Core.Devices;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -18,6 +20,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -35,6 +39,16 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||||
|
|
||||||
|
public List<EssentialsDevice> EnvironmentalControlDevices { get; protected set; }
|
||||||
|
|
||||||
|
public bool HasEnvironmentalControlDevices
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return EnvironmentalControlDevices != null && EnvironmentalControlDevices.Count > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||||
|
|
||||||
@@ -119,6 +133,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
public EssentialsRoomBase(DeviceConfig config)
|
public EssentialsRoomBase(DeviceConfig config)
|
||||||
: base(config)
|
: base(config)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Setup the ShutdownPromptTimer
|
// Setup the ShutdownPromptTimer
|
||||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the basic functionality of an EssentialsRoom
|
/// Describes the basic functionality of an EssentialsRoom
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute
|
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute, IEnvironmentalControls
|
||||||
{
|
{
|
||||||
BoolFeedback OnFeedback { get; }
|
BoolFeedback OnFeedback { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
@@ -66,6 +68,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
bool RunDefaultCallRoute();
|
bool RunDefaultCallRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes environmental controls available on a room such as lighting, shades, temperature, etc.
|
||||||
|
/// </summary>
|
||||||
|
public interface IEnvironmentalControls
|
||||||
|
{
|
||||||
|
List<EssentialsDevice> EnvironmentalControlDevices { get; }
|
||||||
|
|
||||||
|
bool HasEnvironmentalControlDevices { get; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user