Class DeviceFeature
- Namespace
- KasaTapoClient
- Assembly
- KasaTapoClient.dll
Represents a normalized device feature similar to python-kasa's feature interface.
public sealed class DeviceFeature
- Inheritance
-
DeviceFeature
- Inherited Members
Constructors
DeviceFeature(string, string, FeatureKind, object?, string?, bool, double?, double?, IReadOnlyList<string>?)
Initializes a new instance of the DeviceFeature class.
public DeviceFeature(string id, string name, FeatureKind kind, object? value, string? unit = null, bool isReadOnly = true, double? minimumValue = null, double? maximumValue = null, IReadOnlyList<string>? choices = null)
Parameters
idstringThe stable feature identifier.
namestringThe display name of the feature.
kindFeatureKindThe kind of feature.
valueobjectThe current feature value.
unitstringThe optional unit for numeric or informational values.
isReadOnlyboolA value indicating whether the feature is read-only.
minimumValuedouble?The optional minimum numeric value.
maximumValuedouble?The optional maximum numeric value.
choicesIReadOnlyList<string>The optional allowed choice values.
Exceptions
- ArgumentException
Thrown when
idornameis empty or whitespace.
Properties
Choices
Gets the optional allowed choice values.
public IReadOnlyList<string> Choices { get; }
Property Value
Id
Gets the stable feature identifier.
public string Id { get; }
Property Value
IsReadOnly
Gets a value indicating whether the feature is read-only.
public bool IsReadOnly { get; }
Property Value
Kind
Gets the kind of feature.
public FeatureKind Kind { get; }
Property Value
MaximumValue
Gets the optional maximum numeric value.
public double? MaximumValue { get; }
Property Value
MinimumValue
Gets the optional minimum numeric value.
public double? MinimumValue { get; }
Property Value
Name
Gets the display name of the feature.
public string Name { get; }
Property Value
Unit
Gets the optional unit associated with Value.
public string? Unit { get; }
Property Value
Value
Gets the current feature value.
public object? Value { get; }