mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 04:04:58 +00:00
Merge branch 'main' into feature/circuittype-property-versiport
This commit is contained in:
@@ -21,11 +21,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
[Description("Wrapper class for a Relay")]
|
||||
public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// The RelayOutput controlled by this device
|
||||
/// </summary>
|
||||
public Relay RelayOutput { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Feedback to indicate whether the output is on
|
||||
/// </summary>
|
||||
public BoolFeedback OutputIsOnFeedback { get; private set; }
|
||||
|
||||
//Maintained for compatibility with PepperDash.Essentials.Core.Devices.CrestronProcessor
|
||||
/// <summary>
|
||||
/// Constructor for GenericRelayDevice
|
||||
/// </summary>
|
||||
/// <param name="key">key of the device</param>
|
||||
/// <param name="relay">Relay output controlled by this device</param>
|
||||
public GenericRelayDevice(string key, Relay relay) :
|
||||
base(key)
|
||||
{
|
||||
@@ -37,6 +48,13 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
RelayOutput.StateChange += RelayOutput_StateChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for GenericRelayDevice
|
||||
/// </summary>
|
||||
/// <param name="key">key of the device</param>
|
||||
/// <param name="name">name of the device</param>
|
||||
/// <param name="postActivationFunc">function to get the relay output</param>
|
||||
/// <param name="config">IO port configuration</param>
|
||||
public GenericRelayDevice(string key, string name, Func<IOPortConfig, Relay> postActivationFunc,
|
||||
IOPortConfig config)
|
||||
: base(key, name)
|
||||
@@ -212,6 +230,9 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
/// </summary>
|
||||
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor for GenericRelayDeviceFactory
|
||||
/// </summary>
|
||||
public GenericRelayDeviceFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "relayoutput" };
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
/// </summary>
|
||||
public interface IDigitalInput
|
||||
{
|
||||
/// <summary>
|
||||
/// Feedback to indicate the state of the input
|
||||
/// </summary>
|
||||
BoolFeedback InputStateFeedback { get; }
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
/// </summary>
|
||||
public interface IDigitalOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// Feedback to indicate the state of the output
|
||||
/// </summary>
|
||||
BoolFeedback OutputStateFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the output state
|
||||
/// </summary>
|
||||
/// <param name="state">The desired state of the output</param>
|
||||
void SetOutput(bool state);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IHasCresnetBranches
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of Cresnet branches
|
||||
/// </summary>
|
||||
CrestronCollection<CresnetBranch> CresnetBranches { get; }
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,30 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
/// </summary>
|
||||
public interface ISwitchedOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// Feedback to indicate whether the output is on
|
||||
/// </summary>
|
||||
BoolFeedback OutputIsOnFeedback {get;}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the output on
|
||||
/// </summary>
|
||||
void On();
|
||||
|
||||
/// <summary>
|
||||
/// Turns the output off
|
||||
/// </summary>
|
||||
void Off();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a collection of switched outputs
|
||||
/// </summary>
|
||||
public interface ISwitchedOutputCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary of switched outputs by their port number
|
||||
/// </summary>
|
||||
Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user