OperationBuilder

OperationBuilder

Operation to execute as part of a rule

Classes

CopyStateOperation
OperationConfig
SendCommandOrUpdateOperation
TimingItemStateOperation
ToggleOperation

Methods

build(nameopt, descriptionopt, tagsopt, idopt)

Description:
  • Build this rule

Source:
Parameters:
Name Type Attributes Description
name string <optional>

of the rule

description string <optional>

of the rule

tags Array:.<String:> <optional>

of the rule

id string <optional>

of the rule

copyAndSendState() → {CopyStateOperation}

Description:
  • Sends the state from one item to another. Can be used to proxy item state. State is sent as a command.

Source:
Returns:

the operation config

Type
CopyStateOperation

copyState() → {CopyStateOperation}

Description:
  • Copies the state from one item to another. Can be used to proxy item state. State is updated, not sent as a command.

Source:
Returns:

the operation config

Type
CopyStateOperation

inGroup(group) → {OperationBuilder}

Description:
  • Specify the rule group for this rule

Source:
Parameters:
Name Type Description
group string

the group this rule belongs to.

Returns:

this

Type
OperationBuilder

postIt() → {SendCommandOrUpdateOperation}

Description:
  • Specifies a command state should be posted to the target object as a result of this rule firing. This relies on the trigger being the result of a command itself.

Source:
Returns:

the operation

Type
SendCommandOrUpdateOperation

postUpdate(update) → {SendCommandOrUpdateOperation}

Description:
  • Specifies that an update should be posted as a result of this rule firing.

Source:
Parameters:
Name Type Description
update string

the update to send

Returns:

the operation

Type
SendCommandOrUpdateOperation

send(command) → {SendCommandOrUpdateOperation}

Description:
  • Specifies that a command should be sent as a result of this rule firing.

Source:
Parameters:
Name Type Description
command string | number | time.ZonedDateTime | Quantity | HostState

the command to send

Returns:

the operation

Type
SendCommandOrUpdateOperation

sendIt() → {SendCommandOrUpdateOperation}

Description:
  • Specifies a command should be forwarded to the state of the target object as a result of this rule firing. This relies on the trigger being the result of a command itself.

Source:
Returns:

the operation

Type
SendCommandOrUpdateOperation

sendOff() → {SendCommandOrUpdateOperation}

Description:
  • Specifies the command 'OFF' should be sent as a result of this rule firing.

Source:
Returns:

the operation

Type
SendCommandOrUpdateOperation

sendOn() → {SendCommandOrUpdateOperation}

Description:
  • Specifies the command 'ON' should be sent as a result of this rule firing.

Source:
Returns:

the operation

Type
SendCommandOrUpdateOperation

sendToggle() → {ToggleOperation}

Description:
  • Specifies a command should be sent to toggle the state of the target object as a result of this rule firing.

Source:
Returns:

the operation

Type
ToggleOperation