ActionBuilder

@AutomationDsl
class ActionBuilder


Type-safe builder that builds an Action node.

Summary

Public constructors

ActionBuilder(entity: HasId, deviceType: DeviceTypeFactory<DeviceType>?)

Create an ActionBuilder instance.

Public functions

Action

Build an Action.

Unit
command(command: Command)

Build a Command.

Unit
<T : Trait> update(trait: TraitFactory<T>, block: Updater<T>.() -> Unit)

Build an Update from an Updater.

Public properties

lateinit ActionBehavior
DeviceTypeFactory<DeviceType>?

The DeviceType associated with the Action.

HasId

The unique ID of the entity associated with the Action.

Public constructors

ActionBuilder

ActionBuilder(
    entity: HasId,
    deviceType: DeviceTypeFactory<DeviceType>? = null
)

Create an ActionBuilder instance.

Public functions

build

fun build(): Action

Build an Action.

Returns
Action

An Action instance.

command

fun command(command: Command): Unit

Build a Command.

Parameters
command: Command

The Command associated with the Action.

update

fun <T : Trait> update(trait: TraitFactory<T>, block: Updater<T>.() -> Unit): Unit

Build an Update from an Updater.

Public properties

actionBehavior

lateinit var actionBehaviorActionBehavior

deviceType

val deviceTypeDeviceTypeFactory<DeviceType>?

The DeviceType associated with the Action.

entity

val entityHasId

The unique ID of the entity associated with the Action.