protocol DiscoveryController : SendableManages Discovery Candidates for all Structures in a User Account.
This protocol is used to manage the Discovery Candidates for all Structures in a User Account. This includes fetching, caching and freshing the candidates.
Note
This protocol exists to facilitate eventual SRL migration.-
Default implementationcandidates(for:includeDescendants:timeout:)
Returns the Discovery candidates for the given Structure.
Note
Initially the Discovery API is non streaming. The expected usage is:
let candidates = try await discoveryController.candidates(for: structure, includeDescendants: false).first()Default Implementation
Returns the Discovery candidates for the given Structure.
Declaration
Swift
func candidates(for structure: Structure, includeDescendants: Bool, timeout: TimeInterval?) -> any Query<AnyNodeCandidate>Parameters
includeDescendantsWhether to include candidates for all the objects within the specified Structure.
timeoutThe timeout duration in seconds for the initial candidate emission, or nil for no timeout.
Return Value
The Discovery candidates for the given Structure.
-
Default implementationcandidates(for:timeout:)
Returns the Discovery candidates for the given Device.
Note
Initially the Discovery API is non streaming. The expected usage is:
let candidates = try await discoveryController.candidates(for: device).first()Default Implementation
Returns the Discovery candidates for the given Device.
Declaration
Swift
func candidates(for device: HomeDevice, timeout: TimeInterval?) throws -> any Query<AnyNodeCandidate>Parameters
timeoutThe timeout duration in seconds for the initial candidate emission, or nil for no timeout.
Return Value
The Discovery candidates for the given home object.
-
Returns discovery candidates for the given HomeEntity within the specified structure.
Declaration
Swift
@available(*, deprecated, message: "This API is experimental and subject to change.") func candidates(for entity: any HomeEntity, in structureID: String, timeout: TimeInterval?) -> any Query<AnyNodeCandidate>Parameters
timeoutThe timeout duration in seconds for initial candidate emission (default 60.0s).
Return Value
A Query emitting candidates for the entity in the specified structure. If the entity does not belong to this structure, the query emits an empty set.