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
hoststringThe device host name or IP address.
portintThe device control port.
credentialsDeviceCredentialsOptional credentials required for authenticated devices.
connectionOptionsDeviceConnectionOptionsTransport-specific connection options.
timeoutTimeSpan?The per-operation timeout. If null, a five second timeout is used.
Exceptions
- ArgumentException
Thrown when
hostis empty or whitespace.- ArgumentOutOfRangeException
Thrown when
portis outside the TCP/UDP port range.
Properties
ConnectionOptions
Gets the transport-specific connection options.
public DeviceConnectionOptions ConnectionOptions { get; }
Property Value
Credentials
Gets the optional device credentials.
public DeviceCredentials? Credentials { get; }
Property Value
Host
Gets the device host name or IP address.
public string Host { get; }
Property Value
Port
Gets the device control port.
public int Port { get; }
Property Value
Timeout
Gets the per-operation timeout.
public TimeSpan Timeout { get; }