Automation

interface Automation : HasId, BaseAutomation, Updatable

Known direct subclasses
MutableAutomation

Mutable attributes for an Automation.


The main representation an automation, composed of various types of Automation nodes, including Starter instances, Condition instances, Action instances, and more.

Summary

Public functions

suspend Unit

Execute the automation.

suspend Unit

Stop the automation.

Public properties

Boolean

Whether the underlying automation data is compatible with the current SDK.

Boolean

Whether the automation is currently running.

Boolean

Indicates whether or not the automation is valid.

Boolean

Whether the automation can be manually executed via the execute() function.

List<ValidationIssue>

List of automation graph compilation validation issues.

Inherited functions

From com.google.home.Updatable
suspend Automation
update(optimisticReturn: (Automation) -> Unit, init: MutableAutomation.() -> Unit)

Creates a mutable copy of an object and calls the given function to mutate it, then saves it and returns a new immutable copy with the updated state.

Inherited properties

From com.google.home.automation.BaseAutomation
SequentialFlow?

List of Node instances.

String

Description of this automation instance.

Boolean

Whether the automation can execute.

String

User given name for the automation.

From com.google.home.HasId
Id

Opaque ID for the object.

Public functions

execute

suspend fun execute(): Unit

Execute the automation.

stop

suspend fun stop(): Unit

Stop the automation.

Public properties

compatibleWithSdk

val compatibleWithSdkBoolean

Whether the underlying automation data is compatible with the current SDK. When it is not compatible, user will be blocked from editing the automation graph. Metadata (such as name, description, etc) are still allowed to be changed. Activation/Deactivation are still allowed through the Update API. Delete/Get/List are still allowed.

Set to true if the AutomationGraph proto doesn't contain unknown fields.

isRunning

val isRunningBoolean

Whether the automation is currently running.

isValid

val isValidBoolean

Indicates whether or not the automation is valid.

manuallyExecutable

val manuallyExecutableBoolean

Whether the automation can be manually executed via the execute() function.

Set to true if both of the following conditions are true:

  • The Automation is valid.

  • automationGraph contains a ManualStarter node.

    • In some cases, the platform determines the automation can be implicitly manually executed without a ManualStarter node.

validationIssues

val validationIssuesList<ValidationIssue>

List of automation graph compilation validation issues. Empty by default.