GenericTraitProvider

@HomeExperimentalGenericApi
class GenericTraitProvider : TraitProvider


Summary

Public constructors

Public functions

open T?
<T : Trait> trait(traitFactory: TraitFactory<T>)

Access a specific trait on the provider given a caller-provided TraitFactory.

open Set<Trait>

Given a similar accessible trait set as the function above, returns a subset of those traits that are present in the associated HomeConfig.factoryRegistry union'ed with those already known to the extended sub-class (e.g specific DeviceType that is aware of the set of TraitFactorys specified in its type definition).

Public properties

Set<GenericTrait>

Inherited functions

From com.google.home.TraitProvider
open Trait.TraitMetadata?
<T : Trait> metadata(traitFactory: TraitFactory<T>)

Access a specific trait metadata on the provider given a caller-provided TraitFactory.

Public constructors

GenericTraitProvider

GenericTraitProvider(genericTraits: Set<GenericTrait>)

Public functions

trait

open fun <T : Trait> trait(traitFactory: TraitFactory<T>): T?

Access a specific trait on the provider given a caller-provided TraitFactory. The accessible trait set can include traits that are not a part of the type definition but present on this function projection of the device (e.g utility / manufacturer-specific clusters)

traits

open fun traits(): Set<Trait>

Given a similar accessible trait set as the function above, returns a subset of those traits that are present in the associated HomeConfig.factoryRegistry union'ed with those already known to the extended sub-class (e.g specific DeviceType that is aware of the set of TraitFactorys specified in its type definition).

Public properties

genericTraits

val genericTraitsSet<GenericTrait>