StateReader

class StateReader : Node, HasOutput


A class that accesses a trait's state.

Summary

Public constructors

StateReader(entity: HasId, trait: TraitFactory<Trait>, output: String)

Create a StateReader instance from an entity and a Trait.

StateReader(
    entity: HasId,
    deviceType: DeviceTypeFactory<DeviceType>?,
    trait: TraitFactory<Trait>,
    output: String
)

Create a StateReader instance from an entity, a DeviceType, and a Trait.

Public properties

DeviceTypeFactory<DeviceType>?

The DeviceType associated with the StateReader.

HasId

The unique ID for the entity associated with the StateReader.

open String

The unique ID for the StateReader node output.

TraitFactory<Trait>

The Trait associated with the StateReader.

String

The unique ID for the trait associated with the StateReader.

Inherited properties

From com.google.home.automation.Node
String?

String identifier of this node.

Public constructors

StateReader

StateReader(entity: HasId, trait: TraitFactory<Trait>, output: String)

Create a StateReader instance from an entity and a Trait. An entity may be a Device or a Structure.

Parameters
entity: HasId

The unique ID of the entity associated with the StateReader.

trait: TraitFactory<Trait>

The Trait associated with the StateReader.

output: String

Data that uniquely identifies the StateReader. Note that this is different than the StateReader node ID.

StateReader

StateReader(
    entity: HasId,
    deviceType: DeviceTypeFactory<DeviceType>?,
    trait: TraitFactory<Trait>,
    output: String
)

Create a StateReader instance from an entity, a DeviceType, and a Trait. An entity may be a Device or a Structure.

Parameters
entity: HasId

The unique ID of the StateReader.

deviceType: DeviceTypeFactory<DeviceType>?

The DeviceType associated with the Starter.

trait: TraitFactory<Trait>

The Trait associated with the Starter.

output: String

The output message.

Public properties

deviceType

val deviceTypeDeviceTypeFactory<DeviceType>?

The DeviceType associated with the StateReader.

entity

val entityHasId

The unique ID for the entity associated with the StateReader. Expected to be either a HomeDevice or a Structure.

output

open val outputString

The unique ID for the StateReader node output.

trait

val traitTraitFactory<Trait>

The Trait associated with the StateReader.

traitId

val traitIdString

The unique ID for the trait associated with the StateReader.