protocol Automation : BaseAutomationThe main representation of an automation, containing Metadata fields as well as the Automation Graph containing Automation nodes, including Starter instances, Condition instances, Action instances, and more.
-
Indicates whether or not the automation is valid. Users are able to save incomplete automations with non-blocking errors.
Declaration
Swift
var isValid: Bool { get } -
Indicates whether or not the automation is currently running.
Declaration
Swift
var isRunning: Bool { get } -
List of Validation Issues.
Declaration
Swift
var validationIssues: [AutomationValidationIssue] { get } -
Whether the automation can be manually executed. Set to
trueif both of the following conditions aretrue:- The [Automation] is valid.
automationGraphcontains a ManualStarter node.- In some cases, the platform determines the automation can be implicitly manually executed without a ManualStarter node.
Declaration
Swift
var manuallyExecutable: Bool { get } -
Whether the underlying automation data is compatible with the current SDK. Set to
trueif the automationGraph doesn’t contain any fields that are unknown to the current SDK.Declaration
Swift
var compatibleWithSdk: Bool { get } -
Executes the automation.
Throws
HomeErrorif execution fails.Declaration
Swift
func execute() async throws -
Stops the automation.
Throws
HomeErrorif execution stop fails.Declaration
Swift
func stop() async throws -
Performs an update on the automation.
Declaration
Swift
func update(_ block: (MutableAutomationData) -> Void) async throws -> any AutomationParameters
block- A closure that receives an instance of
MutableAutomationDatato make desired updates.Return Value
An automation with the applied updates.