fix: add changes from code review

This commit is contained in:
Andrew Welker
2025-07-25 09:51:04 -05:00
parent 08cc84a8e8
commit 58bcc3315d
3 changed files with 286 additions and 4 deletions

View File

@@ -19,11 +19,10 @@ namespace PepperDash.Essentials.Core
{
foreach (var typeName in TypeNames)
{
//Debug.LogMessage(LogEventLevel.Verbose, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
string description = descriptionAttribute != null && descriptionAttribute.Length > 0
? descriptionAttribute[0].Description
: throw new InvalidOperationException($"No DescriptionAttribute found for type {typeof(T).FullName}");
string description = descriptionAttribute != null && descriptionAttribute.Length > 0
? descriptionAttribute[0].Description
: "No description available";
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
ProcessorExtensionDeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
}

View File

@@ -43,6 +43,7 @@ namespace PepperDash.Essentials.Core
/// it will NOT reflect an actual value from a device until <seealso cref="FireUpdate"/> has been called
/// </remarks>
/// <param name="valueFunc">Delegate to invoke when this feedback needs to be updated</param>
[Obsolete("use constructor with Key parameter. This constructor will be removed in a future version")]
public IntFeedback(Func<int> valueFunc)
: this(null, valueFunc)
{