mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-30 21:04:48 +00:00
fix: add changes from code review
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user