wip: update XML comments

This commit is contained in:
Erik Meyer
2026-01-28 16:13:11 -05:00
parent ca77506108
commit e0ee5b0474
14 changed files with 330 additions and 101 deletions

View File

@@ -22,6 +22,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public string Description { get; private set; }
/// <summary>
/// Constructor for CrestronGlobalSecretsProvider
/// </summary>
/// <param name="key">The key for the secret provider</param>
public CrestronGlobalSecretsProvider(string key)
{
Key = key;

View File

@@ -23,7 +23,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public string Description { get; private set; }
/// <summary>
/// Constructor for CrestronLocalSecretsProvider
/// </summary>
/// <param name="key">The key for the secret provider</param>
public CrestronLocalSecretsProvider(string key)
{
Key = key;

View File

@@ -11,11 +11,27 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class CrestronSecret : ISecret
{
/// <summary>
/// Gets the Provider
/// </summary>
public ISecretProvider Provider { get; private set; }
/// <summary>
/// Gets the Key
/// </summary>
public string Key { get; private set; }
/// <summary>
/// Gets the Value
/// </summary>
public object Value { get; private set; }
/// <summary>
/// Constructor for CrestronSecret
/// </summary>
/// <param name="key">key for the secret</param>
/// <param name="value">value of the secret</param>
/// <param name="provider">provider of the secret</param>
public CrestronSecret(string key, string value, ISecretProvider provider)
{
Key = key;

View File

@@ -7,8 +7,14 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// SecretsManager static class
/// </summary>
public static class SecretsManager
{
/// <summary>
/// Gets the Secrets dictionary
/// </summary>
public static Dictionary<string, ISecretProvider> Secrets { get; private set; }
/// <summary>

View File

@@ -14,8 +14,15 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class SecretsPropertiesConfig
{
/// <summary>
/// Gets or sets the Provider
/// </summary>
[JsonProperty("provider")]
public string Provider { get; set; }
/// <summary>
/// Gets or sets the Key
/// </summary>
[JsonProperty("key")]
public string Key { get; set; }
}

View File

@@ -8,6 +8,9 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShades
{
/// <summary>
/// List of shades controlled by this device
/// </summary>
List<IShadesOpenCloseStop> Shades { get; }
}
@@ -16,17 +19,47 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesOpenCloseStop
{
/// <summary>
/// Opens the shade
/// </summary>
void Open();
/// <summary>
/// Closes the shade
/// </summary>
void Close();
/// <summary>
/// Stops the shade
/// </summary>
void Stop();
}
/// <summary>
/// Requirements for a device that implements Open/Close/Stop shade control with presets
/// </summary>
public interface IShadesOpenClosePreset : IShadesOpenCloseStop
{
/// <summary>
/// Recalls the preset
/// </summary>
/// <param name="presetNumber">preset number to recall</param>
void RecallPreset(uint presetNumber);
/// <summary>
/// Saves the preset
/// </summary>
/// <param name="presetNumber">preset number to save</param>
void SavePreset(uint presetNumber);
/// <summary>
/// Label for the preset button
/// </summary>
string StopOrPresetButtonLabel { get; }
/// <summary>
/// Event raised when a preset is recalled
/// </summary>
event EventHandler PresetSaved;
}
@@ -36,7 +69,14 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesRaiseLowerFeedback
{
/// <summary>
/// Feedback to indicate if the shade is lowering
/// </summary>
BoolFeedback ShadeIsLoweringFeedback { get; }
/// <summary>
/// Feedback to indicate if the shade is raising
/// </summary>
BoolFeedback ShadeIsRaisingFeedback { get; }
}
@@ -45,7 +85,14 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesOpenClosedFeedback: IShadesOpenCloseStop
{
/// <summary>
/// Feedback to indicate if the shade is open
/// </summary>
BoolFeedback ShadeIsOpenFeedback { get; }
/// <summary>
/// Feedback to indicate if the shade is closed
/// </summary>
BoolFeedback ShadeIsClosedFeedback { get; }
}
@@ -54,8 +101,19 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesStopOrMove
{
/// <summary>
/// Raises the shade or stops it if it's already moving
/// </summary>
void OpenOrStop();
/// <summary>
/// Lowers the shade or stops it if it's already moving
/// </summary>
void CloseOrStop();
/// <summary>
/// Opens, closes, or stops the shade depending on current state
/// </summary>
void OpenCloseOrStop();
}
@@ -64,6 +122,9 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesStopFeedback : IShadesOpenCloseStop
{
/// <summary>
/// Feedback to indicate if the shade is stopped
/// </summary>
BoolFeedback IsStoppedFeedback { get; }
}
@@ -72,6 +133,10 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesPosition
{
/// <summary>
/// Gets the current position of the shade
/// </summary>
/// <param name="value">value of the position to set</param>
void SetPosition(ushort value);
}
@@ -80,18 +145,31 @@ namespace PepperDash.Essentials.Core.Shades
/// </summary>
public interface IShadesFeedback: IShadesPosition, IShadesStopFeedback
{
/// <summary>
/// Feedback to indicate the current position of the shade
/// </summary>
IntFeedback PositionFeedback { get; }
}
/// <summary>
///
/// Feedback for scenes
/// </summary>
public interface ISceneFeedback
{
/// <summary>
/// Runs the scene
/// </summary>
void Run();
/// <summary>
/// Feedback to indicate if all shades are at the scene position
/// </summary>
BoolFeedback AllAreAtSceneFeedback { get; }
}
/// <summary>
/// Combines basic shade interfaces for Crestron Basic shades
/// </summary>
public interface ICrestronBasicShade : IShadesOpenClosedFeedback,
IShadesStopOrMove, IShadesFeedback, IShadesRaiseLowerFeedback
{

View File

@@ -9,10 +9,17 @@ using PepperDash.Essentials.Core.CrestronIO;
namespace PepperDash.Essentials.Core.Shades
{
/// <summary>
/// Base class for shades
/// </summary>
[Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key of the shade device</param>
/// <param name="name">name of the shade device</param>
public ShadeBase(string key, string name)
: base(key, name)
{
@@ -21,8 +28,19 @@ namespace PepperDash.Essentials.Core.Shades
#region iShadesOpenClose Members
/// <summary>
/// Opens the shade
/// </summary>
public abstract void Open();
/// <summary>
/// Stops the shade
/// </summary>
public abstract void Stop();
/// <summary>
/// Closes the shade
/// </summary>
public abstract void Close();
#endregion

View File

@@ -17,7 +17,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Runs action when Sig is pressed
/// </summary>
/// <param name="sig"></param>
/// <param name="sig">signal pressed</param>
/// <param name="act">action to run</param>
public static void Pressed(Sig sig, Action act) { if (sig.BoolValue) act(); }
/// <summary>

View File

@@ -13,27 +13,36 @@ namespace PepperDash.Essentials.Core.SmartObjects
/// </summary>
public class SmartObjectDPad : SmartObjectHelperBase
{
/// <summary>
/// Gets or sets the SigUp
/// </summary>
/// <summary>
/// Gets or sets the SigUp
/// </summary>
public BoolOutputSig SigUp { get { return GetBoolOutputNamed("Up"); } }
/// <summary>
/// Gets or sets the SigDown
/// </summary>
/// <summary>
/// Gets or sets the SigDown
/// </summary>
public BoolOutputSig SigDown { get { return GetBoolOutputNamed("Down"); } }
/// <summary>
/// Gets or sets the SigLeft
/// </summary>
/// <summary>
/// Gets or sets the SigLeft
/// </summary>
public BoolOutputSig SigLeft { get { return GetBoolOutputNamed("Left"); } }
/// <summary>
/// Gets or sets the SigRight
/// </summary>
/// <summary>
/// Gets or sets the SigRight
/// </summary>
public BoolOutputSig SigRight { get { return GetBoolOutputNamed("Right"); } }
/// <summary>
/// Gets or sets the SigCenter
/// </summary>
/// <summary>
/// Gets or sets the SigCenter
/// </summary>
public BoolOutputSig SigCenter { get { return GetBoolOutputNamed("Center"); } }
/// <summary>
/// Constructor
/// </summary>
/// <param name="so">smart object</param>
/// <param name="useUserObjectHandler">use user object handler if true</param>
public SmartObjectDPad(SmartObject so, bool useUserObjectHandler)
: base(so, useUserObjectHandler)
{

View File

@@ -17,14 +17,24 @@ namespace PepperDash.Essentials.Core.SmartObjects
/// </summary>
public class SmartObjectDynamicList : SmartObjectHelperBase
{
/// <summary>
/// Sig name for Scroll To Item
/// </summary>
public const string SigNameScrollToItem = "Scroll To Item";
/// <summary>
/// Sig name for Set Number of Items
/// </summary>
public const string SigNameSetNumberOfItems = "Set Number of Items";
/// <summary>
/// Gets or sets the NameSigOffset
/// </summary>
/// <summary>
/// Gets or sets the NameSigOffset
/// </summary>
public uint NameSigOffset { get; private set; }
/// <summary>
/// Gets or sets the Count
/// </summary>
public ushort Count
{
get
@@ -34,9 +44,9 @@ namespace PepperDash.Essentials.Core.SmartObjects
set { SmartObject.UShortInput[SigNameSetNumberOfItems].UShortValue = value; }
}
/// <summary>
/// Gets or sets the MaxCount
/// </summary>
/// <summary>
/// Gets or sets the MaxCount
/// </summary>
public int MaxCount { get; private set; }
/// <summary>
@@ -62,9 +72,9 @@ namespace PepperDash.Essentials.Core.SmartObjects
}
}
/// <summary>
/// SetItem method
/// </summary>
/// <summary>
/// SetItem method
/// </summary>
public void SetItem(uint index, string mainText, string iconName, Action<bool> action)
{
SetItemMainText(index, mainText);
@@ -83,9 +93,9 @@ namespace PepperDash.Essentials.Core.SmartObjects
//}
}
/// <summary>
/// SetItemMainText method
/// </summary>
/// <summary>
/// SetItemMainText method
/// </summary>
public void SetItemMainText(uint index, string text)
{
if (index > MaxCount) return;
@@ -93,27 +103,27 @@ namespace PepperDash.Essentials.Core.SmartObjects
(SmartObject.Device as BasicTriList).StringInput[NameSigOffset + index].StringValue = text;
}
/// <summary>
/// SetItemIcon method
/// </summary>
/// <summary>
/// SetItemIcon method
/// </summary>
public void SetItemIcon(uint index, string iconName)
{
if (index > MaxCount) return;
SmartObject.StringInput[string.Format("Set Item {0} Icon Serial", index)].StringValue = iconName;
}
/// <summary>
/// SetItemButtonAction method
/// </summary>
/// <summary>
/// SetItemButtonAction method
/// </summary>
public void SetItemButtonAction(uint index, Action<bool> action)
{
if (index > MaxCount) return;
SmartObject.BooleanOutput[string.Format("Item {0} Pressed", index)].UserObject = action;
}
/// <summary>
/// SetFeedback method
/// </summary>
/// <summary>
/// SetFeedback method
/// </summary>
public void SetFeedback(uint index, bool interlocked)
{
if (interlocked)
@@ -121,9 +131,9 @@ namespace PepperDash.Essentials.Core.SmartObjects
SmartObject.BooleanInput[string.Format("Item {0} Selected", index)].BoolValue = true;
}
/// <summary>
/// ClearFeedbacks method
/// </summary>
/// <summary>
/// ClearFeedbacks method
/// </summary>
public void ClearFeedbacks()
{
for(int i = 1; i<= Count; i++)

View File

@@ -11,21 +11,26 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core.SmartObjects
{
/// <summary>
/// Represents a SmartObjectHelperBase
/// </summary>
/// <summary>
/// Represents a SmartObjectHelperBase
/// </summary>
public class SmartObjectHelperBase
{
/// <summary>
/// Gets or sets the SmartObject
/// </summary>
/// <summary>
/// Gets or sets the SmartObject
/// </summary>
public SmartObject SmartObject { get; private set; }
/// <summary>
/// Gets or sets the Validated
/// </summary>
/// <summary>
/// Gets or sets the Validated
/// </summary>
public bool Validated { get; protected set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="so">smart object</param>
/// <param name="useUserObjectHandler">use the user object hadnler if true</param>
public SmartObjectHelperBase(SmartObject so, bool useUserObjectHandler)
{
SmartObject = so;
@@ -37,6 +42,9 @@ namespace PepperDash.Essentials.Core.SmartObjects
}
}
/// <summary>
/// Destructor
/// </summary>
~SmartObjectHelperBase()
{
SmartObject.SigChange -= this.SmartObject_SigChange;
@@ -47,9 +55,6 @@ namespace PepperDash.Essentials.Core.SmartObjects
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <summary>
/// GetBoolOutputNamed method
/// </summary>
public BoolOutputSig GetBoolOutputNamed(string name)
{
if (SmartObject.BooleanOutput.Contains(name))

View File

@@ -8,52 +8,90 @@ using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core.SmartObjects
{
/// <summary>
/// Represents a SmartObjectNumeric
/// </summary>
/// <summary>
/// Represents a SmartObjectNumeric
/// </summary>
public class SmartObjectNumeric : SmartObjectHelperBase
{
/// <summary>
/// Gets or sets the Misc1SigName
/// </summary>
public string Misc1SigName { get; set; }
/// <summary>
/// Gets or sets the Misc2SigName
/// </summary>
public string Misc2SigName { get; set; }
{
/// <summary>
/// Gets or sets the Misc1SigName
/// </summary>
public string Misc1SigName { get; set; }
public BoolOutputSig Digit1 { get { return GetBoolOutputNamed("1"); } }
public BoolOutputSig Digit2 { get { return GetBoolOutputNamed("2"); } }
public BoolOutputSig Digit3 { get { return GetBoolOutputNamed("3"); } }
public BoolOutputSig Digit4 { get { return GetBoolOutputNamed("4"); } }
/// <summary>
/// Gets or sets the Digit5
/// </summary>
public BoolOutputSig Digit5 { get { return GetBoolOutputNamed("5"); } }
public BoolOutputSig Digit6 { get { return GetBoolOutputNamed("6"); } }
public BoolOutputSig Digit7 { get { return GetBoolOutputNamed("7"); } }
public BoolOutputSig Digit8 { get { return GetBoolOutputNamed("8"); } }
/// <summary>
/// Gets or sets the Digit9
/// </summary>
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
/// <summary>
/// Gets or sets the Digit0
/// </summary>
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
/// <summary>
/// Gets or sets the Misc1
/// </summary>
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed(Misc1SigName); } }
/// <summary>
/// Gets or sets the Misc2
/// </summary>
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed(Misc2SigName); } }
/// <summary>
/// Gets or sets the Misc2SigName
/// </summary>
public string Misc2SigName { get; set; }
public SmartObjectNumeric(SmartObject so, bool useUserObjectHandler) : base(so, useUserObjectHandler)
{
Misc1SigName = "Misc_1";
Misc2SigName = "Misc_2";
}
}
/// <summary>
/// Gets or sets the Digit1
/// </summary>
public BoolOutputSig Digit1 { get { return GetBoolOutputNamed("1"); } }
/// <summary>
/// Gets or sets the Digit2
/// </summary>
public BoolOutputSig Digit2 { get { return GetBoolOutputNamed("2"); } }
/// <summary>
/// Gets or sets the Digit3
/// </summary>
public BoolOutputSig Digit3 { get { return GetBoolOutputNamed("3"); } }
/// <summary>
/// Gets or sets the Digit4
/// </summary>
public BoolOutputSig Digit4 { get { return GetBoolOutputNamed("4"); } }
/// <summary>
/// Gets or sets the Digit5
/// </summary>
public BoolOutputSig Digit5 { get { return GetBoolOutputNamed("5"); } }
/// <summary>
/// Gets or sets the Digit6
/// </summary>
public BoolOutputSig Digit6 { get { return GetBoolOutputNamed("6"); } }
/// <summary>
/// Gets or sets the Digit7
/// </summary>
public BoolOutputSig Digit7 { get { return GetBoolOutputNamed("7"); } }
/// <summary>
/// Gets or sets the Digit8
/// </summary>
public BoolOutputSig Digit8 { get { return GetBoolOutputNamed("8"); } }
/// <summary>
/// Gets or sets the Digit9
/// </summary>
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
/// <summary>
/// Gets or sets the Digit0
/// </summary>
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
/// <summary>
/// Gets or sets the Misc1
/// </summary>
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed(Misc1SigName); } }
/// <summary>
/// Gets or sets the Misc2
/// </summary>
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed(Misc2SigName); } }
/// <summary>
/// Constructor
/// </summary>
/// <param name="so">smart object</param>
/// <param name="useUserObjectHandler">use user handler if true</param>
public SmartObjectNumeric(SmartObject so, bool useUserObjectHandler) : base(so, useUserObjectHandler)
{
Misc1SigName = "Misc_1";
Misc2SigName = "Misc_2";
}
}
}

View File

@@ -30,35 +30,60 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class SubpageReferenceList
{
/// <summary>
/// Gets or sets the Count
/// </summary>
public ushort Count
{
get { return SetNumberOfItemsSig.UShortValue; }
set { SetNumberOfItemsSig.UShortValue = value; }
}
/// <summary>
/// Gets or sets the MaxDefinedItems
/// </summary>
public ushort MaxDefinedItems { get; private set; }
/// <summary>
/// Gets or sets the ScrollToItemSig
/// </summary>
public UShortInputSig ScrollToItemSig { get; private set; }
UShortInputSig SetNumberOfItemsSig;
/// <summary>
/// Gets or sets the BoolIncrement
/// </summary>
public uint BoolIncrement { get; protected set; }
/// <summary>
/// Gets or sets the UShortIncrement
/// </summary>
public uint UShortIncrement { get; protected set; }
/// <summary>
/// Gets or sets the StringIncrement
/// </summary>
public uint StringIncrement { get; protected set; }
/// <summary>
/// Gets or sets the SRL
/// </summary>
protected readonly SmartObject SRL;
/// <summary>
/// Gets the list of items in the SRL
/// </summary>
protected readonly List<SubpageReferenceListItem> Items = new List<SubpageReferenceListItem>();
/// <summary>
/// Constructor
/// </summary>
/// <param name="triList">trilist for the smart object</param>
/// <param name="smartObjectId">smart object ID</param>
/// <param name="boolIncrement"></param>
/// <param name="ushortIncrement"></param>
/// <param name="stringIncrement"></param>
public SubpageReferenceList(BasicTriListWithSmartObject triList, uint smartObjectId,
uint boolIncrement, uint ushortIncrement, uint stringIncrement)
{

View File

@@ -17,8 +17,17 @@ namespace PepperDash.Essentials.Core
/// The list that this lives in
/// </summary>
protected SubpageReferenceList Owner;
/// <summary>
/// The index of this item
/// </summary>
protected uint Index;
/// <summary>
/// Constructor
/// </summary>
/// <param name="index">index of the item</param>
/// <param name="owner">owner of the item</param>
public SubpageReferenceListItem(uint index, SubpageReferenceList owner)
{
Index = index;