docs: update XML comments for Essentials Core

This commit is contained in:
Andrew Welker 2026-02-09 08:58:52 -06:00
parent 0764685c51
commit f88bb13367
260 changed files with 7018 additions and 1318 deletions

View file

@ -16,13 +16,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class DeviceJsonApi
{
/// <summary>
///
/// </summary>
/// <param name="json"></param>
/// <summary>
/// DoDeviceActionWithJson method
/// </summary>
/// <param name="json">json method</param>
public static void DoDeviceActionWithJson(string json)
{
if (String.IsNullOrEmpty(json))
@ -45,13 +42,10 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
///
/// </summary>
/// <param name="action"></param>
/// <summary>
/// DoDeviceAction method
/// </summary>
/// <param name="action">action method</param>
public static void DoDeviceAction(DeviceActionWrapper action)
{
var key = action.DeviceKey;
@ -111,6 +105,10 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// DoDeviceActionAsync method
/// </summary>
/// <param name="action">action method</param>
public static async Task DoDeviceActionAsync(DeviceActionWrapper action)
{
var key = action.DeviceKey;
@ -194,11 +192,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets the properties on a device
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
/// <summary>
/// GetProperties method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the properties of the device</returns>
public static string GetProperties(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@ -214,12 +209,9 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets a property from a device path by name
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
/// <summary>
/// GetPropertyByName method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <param name="propertyName">The name of the property to get</param>
/// <returns>The value of the property</returns>
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
var dev = FindObjectOnPath(deviceObjectPath);
@ -243,11 +235,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets the methods on a device
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
/// <summary>
/// GetMethods method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the methods of the device</returns>
public static string GetMethods(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@ -263,8 +252,10 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// GetApiMethods method
/// Gets the API methods on a device
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the API methods of the device</returns>
public static string GetApiMethods(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@ -284,6 +275,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// FindObjectOnPath method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>The object found at the specified path</returns>
public static object FindObjectOnPath(string deviceObjectPath)
{
var path = deviceObjectPath.Split('.');
@ -369,11 +362,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Sets a property on an object.
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <returns></returns>
/// <summary>
/// SetProperty method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the result of setting the property</returns>
public static string SetProperty(string deviceObjectPath)
{
throw new NotImplementedException("This could be really useful. Finish it please");
@ -393,13 +383,21 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Represents a DeviceActionWrapper
/// </summary>
public class DeviceActionWrapper
{
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
/// <summary>
/// Gets or sets the MethodName
/// </summary>
public string MethodName { get; set; }
/// <summary>
/// Gets or sets the Params
/// </summary>
@ -413,19 +411,25 @@ namespace PepperDash.Essentials.Core
{
private object Parent;
[JsonIgnore]
/// <summary>
/// Gets or sets the PropInfo
/// </summary>
[JsonIgnore]
public PropertyInfo PropInfo { get; private set; }
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get { return PropInfo.Name; } }
/// <summary>
/// Gets or sets the Type
/// </summary>
public string Type { get { return PropInfo.PropertyType.Name; } }
/// <summary>
/// Gets or sets the Value
/// </summary>
public string Value
{
get
@ -450,12 +454,17 @@ namespace PepperDash.Essentials.Core
/// Gets or sets the CanRead
/// </summary>
public bool CanRead { get { return PropInfo.CanRead; } }
/// <summary>
/// Gets or sets the CanWrite
/// </summary>
public bool CanWrite { get { return PropInfo.CanWrite; } }
/// <summary>
/// PropertyNameType constructor
/// </summary>
/// <param name="info">property info</param>
/// <param name="parent">parent object</param>
public PropertyNameType(PropertyInfo info, object parent)
{
PropInfo = info;
@ -468,16 +477,20 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class MethodNameParams
{
[JsonIgnore]
/// <summary>
/// Gets or sets the MethodInfo
/// </summary>
[JsonIgnore]
public MethodInfo MethodInfo { get; private set; }
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get { return MethodInfo.Name; } }
/// <summary>
/// Gets or sets the Params
/// </summary>
public IEnumerable<NameType> Params
{
get
@ -487,6 +500,10 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// MethodNameParams constructor
/// </summary>
/// <param name="info">method info</param>
public MethodNameParams(MethodInfo info)
{
MethodInfo = info;
@ -508,10 +525,10 @@ namespace PepperDash.Essentials.Core
public string Type { get; set; }
}
[AttributeUsage(AttributeTargets.All)]
/// <summary>
/// Represents a ApiAttribute
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class ApiAttribute : Attribute
{