Class ChildSetupModule
- Namespace
- KasaTapoClient
- Assembly
- KasaTapoClient.dll
Provides child setup and pairing operations for smart hub devices.
public sealed class ChildSetupModule
- Inheritance
-
ChildSetupModule
- Inherited Members
Properties
SupportedCategories
Gets the categories supported for child pairing, when reported.
public IReadOnlyList<string> SupportedCategories { get; }
Property Value
Methods
GetDetectedDevicesAsync(CancellationToken)
Gets the current detected child devices from the hub scan state.
public Task<ChildSetupScanResult> GetDetectedDevicesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token for the operation.
Returns
- Task<ChildSetupScanResult>
The detected child devices and supported categories reported by the hub.
Exceptions
- InvalidOperationException
Thrown when the parent device does not support smart hub child setup operations.
PairAsync(IReadOnlyList<DetectedChildDevice>, CancellationToken)
Pairs the specified detected child devices.
public Task<IReadOnlyList<DetectedChildDevice>> PairAsync(IReadOnlyList<DetectedChildDevice> devices, CancellationToken cancellationToken = default)
Parameters
devicesIReadOnlyList<DetectedChildDevice>The detected child devices to pair with the hub.
cancellationTokenCancellationTokenThe cancellation token for the operation.
Returns
- Task<IReadOnlyList<DetectedChildDevice>>
The subset of requested devices that the hub confirmed after refresh.
Exceptions
- InvalidOperationException
Thrown when the parent device does not support smart hub child setup operations.
ScanAsync(int, CancellationToken)
Starts a child-device scan, waits for the specified timeout, and returns detected devices.
public Task<ChildSetupScanResult> ScanAsync(int timeoutSeconds = 10, CancellationToken cancellationToken = default)
Parameters
timeoutSecondsintThe number of seconds to wait before reading the hub's detected child-device list.
cancellationTokenCancellationTokenThe cancellation token for the operation.
Returns
- Task<ChildSetupScanResult>
The detected child devices and supported categories reported by the hub.
Exceptions
- InvalidOperationException
Thrown when the parent device does not support smart hub child setup operations.
UnpairAsync(string, CancellationToken)
Removes a child device from the hub.
public Task UnpairAsync(string childDeviceId, CancellationToken cancellationToken = default)
Parameters
childDeviceIdstringThe child device identifier to remove from the hub.
cancellationTokenCancellationTokenThe cancellation token for the operation.
Returns
- Task
A task that completes when the child device has been removed and the parent state refreshed.
Exceptions
- InvalidOperationException
Thrown when the parent device does not support smart hub child setup operations.