struct Actionextension Action : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Identifiable, Node, SendableBase struct for all Actions in the automation graph.
-
The stable identity of the entity associated with this instance.
Declaration
Swift
let id: String -
The behavior to take when the Action is executed.
Declaration
Swift
let behavior: any ActionBehavior -
An expression that specifies an entity or a list of entities associated with the
Actionat runtime.When entityExpression represents a single entity, entityExpression will be Constant(value: AnyAutomationEntity). Otherwise, entityExpression is an Expression, capable of resolving to any number of entities.
Declaration
Swift
let entityExpression: any Expression -
The unique ID for the entity associated with the Action.
entity will be nil if the init(entityExpression: …) was used and the entityExpression is not a Constant to an AnyAutomationEntity.
Declaration
Swift
var entity: (any HomeObject)? { get } -
For device entities, the identifier of the
DeviceTypeassociated with the action.deviceType will be nil if entity is nil or not a device, such as a Structure or Room.
Declaration
Swift
var deviceType: (any DeviceType.Type)? { get } -
For device entities, the string-based identifier for the
DeviceType. If thedeviceTypeisUnknownDeviceTypeit will refer to the original DeviceType ID provided.deviceTypeID will be nil if entity is nil or not a device, such as a Structure or Room.
Declaration
Swift
var deviceTypeID: String? { get } -
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Swift
static func == (lhs: Action, rhs: Action) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Returns true if the nodes are equal, false otherwise.
Declaration
Swift
func isEqual(to other: any Node) -> Bool -
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the
String(describing:)initializer. This initializer works with any type, and uses the customdescriptionproperty for types that conform toCustomStringConvertible:struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)"The conversion of
pto a string in the assignment tosuses thePointtype’sdescriptionproperty.Declaration
Swift
var description: String { get }