Table of Contents

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

id string

The stable feature identifier.

name string

The display name of the feature.

kind FeatureKind

The kind of feature.

value object

The current feature value.

unit string

The optional unit for numeric or informational values.

isReadOnly bool

A value indicating whether the feature is read-only.

minimumValue double?

The optional minimum numeric value.

maximumValue double?

The optional maximum numeric value.

choices IReadOnlyList<string>

The optional allowed choice values.

Exceptions

ArgumentException

Thrown when id or name is empty or whitespace.

Properties

Choices

Gets the optional allowed choice values.

public IReadOnlyList<string> Choices { get; }

Property Value

IReadOnlyList<string>

Id

Gets the stable feature identifier.

public string Id { get; }

Property Value

string

IsReadOnly

Gets a value indicating whether the feature is read-only.

public bool IsReadOnly { get; }

Property Value

bool

Kind

Gets the kind of feature.

public FeatureKind Kind { get; }

Property Value

FeatureKind

MaximumValue

Gets the optional maximum numeric value.

public double? MaximumValue { get; }

Property Value

double?

MinimumValue

Gets the optional minimum numeric value.

public double? MinimumValue { get; }

Property Value

double?

Name

Gets the display name of the feature.

public string Name { get; }

Property Value

string

Unit

Gets the optional unit associated with Value.

public string? Unit { get; }

Property Value

string

Value

Gets the current feature value.

public object? Value { get; }

Property Value

object