Table of Contents

Class DeviceConfiguration

Namespace
KasaTapoClient
Assembly
KasaTapoClient.dll

Represents the configuration used to connect to a device.

public sealed class DeviceConfiguration
Inheritance
DeviceConfiguration
Inherited Members

Constructors

DeviceConfiguration(string, int, DeviceCredentials?, DeviceConnectionOptions?, TimeSpan?)

Initializes a new instance of the DeviceConfiguration class.

public DeviceConfiguration(string host, int port = 9999, DeviceCredentials? credentials = null, DeviceConnectionOptions? connectionOptions = null, TimeSpan? timeout = null)

Parameters

host string

The device host name or IP address.

port int

The device control port.

credentials DeviceCredentials

Optional credentials required for authenticated devices.

connectionOptions DeviceConnectionOptions

Transport-specific connection options.

timeout TimeSpan?

The per-operation timeout. If null, a five second timeout is used.

Exceptions

ArgumentException

Thrown when host is empty or whitespace.

ArgumentOutOfRangeException

Thrown when port is outside the TCP/UDP port range.

Properties

ConnectionOptions

Gets the transport-specific connection options.

public DeviceConnectionOptions ConnectionOptions { get; }

Property Value

DeviceConnectionOptions

Credentials

Gets the optional device credentials.

public DeviceCredentials? Credentials { get; }

Property Value

DeviceCredentials

Host

Gets the device host name or IP address.

public string Host { get; }

Property Value

string

Port

Gets the device control port.

public int Port { get; }

Property Value

int

Timeout

Gets the per-operation timeout.

public TimeSpan Timeout { get; }

Property Value

TimeSpan