GenericEventProvider

@HomeExperimentalGenericApi
class GenericEventProvider : HasGenericEvents


Summary

Public constructors

GenericEventProvider(
    device: HomeDevice?,
    genericTraits: Set<GenericTrait>
)

Public functions

open Flow<Event>

Gets a flow of all Events available for the object.

open Flow<T>
<T : Event> events(event: EventFactory<T>)

Gets a flow of a specific Event.

open Flow<Event>
<T : Trait> events(trait: TraitFactory<T>)

Gets a flow of all Events by this Trait.

open Flow<GenericEvent>

Gets a flow of all Events available for the object.

open Flow<GenericEvent>

Gets a flow of a specific Event.

open Flow<GenericEvent>

Gets a flow of all Events by this Trait.

Public properties

List<String>

Public constructors

GenericEventProvider

GenericEventProvider(
    device: HomeDevice?,
    genericTraits: Set<GenericTrait>
)

Public functions

events

open fun events(): Flow<Event>

Gets a flow of all Events available for the object.

Returns
Flow<Event>

The flow for all Events on this object.

events

open fun <T : Event> events(event: EventFactory<T>): Flow<T>

Gets a flow of a specific Event.

Parameters
event: EventFactory<T>

the Event to subscribe to.

Returns
Flow<T>

the flow for the Event.

events

open fun <T : Trait> events(trait: TraitFactory<T>): Flow<Event>

Gets a flow of all Events by this Trait.

Parameters
trait: TraitFactory<T>

the Trait for which to subscribe to Events.

Returns
Flow<Event>

the flow for Trait Events.

genericEvents

open fun genericEvents(): Flow<GenericEvent>

Gets a flow of all Events available for the object.

Returns
Flow<GenericEvent>

The flow for all Events on this object.

genericEvents

open fun genericEvents(eventId: String): Flow<GenericEvent>

Gets a flow of a specific Event.

Parameters
eventId: String

the EventId to subscribe to.

Returns
Flow<GenericEvent>

the flow for the Event.

genericTraitEvents

open fun genericTraitEvents(traitId: String): Flow<GenericEvent>

Gets a flow of all Events by this Trait.

Parameters
traitId: String

the Trait for which to subscribe to Events.

Returns
Flow<GenericEvent>

the flow for Trait Events.

Public properties

supportedEvents

val supportedEventsList<String>