HasGenericEvents

@HomeExperimentalGenericApi
interface HasGenericEvents : HasEvents


Interface implemented by GenericDeviceType objects that have observable events.

Summary

Public functions

Flow<GenericEvent>

Gets a flow of all Events available for the object.

Flow<GenericEvent>

Gets a flow of a specific Event.

Flow<GenericEvent>

Gets a flow of all Events by this Trait.

Inherited functions

From com.google.home.HasEvents
Flow<Event>

Gets a flow of all Events available for the object.

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

Gets a flow of a specific Event.

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

Gets a flow of all Events by this Trait.

Public functions

genericEvents

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

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

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.