struct StateReaderextension StateReader : Equatable, Hashable, Identifiable, Node, NodeWithOutput, SendableA class that accesses a trait’s state, used for Condition instances.
-
The stable identity of the entity associated with this instance.
Declaration
Swift
let id: String -
The string-based identifier for the
Trait. If trait isUnknownTraitit will refer to the originalTraitID provided.Declaration
Swift
let traitID: String -
The unique ID for the
StateReadernode output. Must be unique perAutomation.Declaration
Swift
let output: String -
An expression that selects an entity or a list of entities associated with the
StateReaderat runtime.When entityExpression represents a single explicit 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 entity for the
HomeDeviceorStructureassociated with theStateReader.entity will be nil if the init(entityExpression: …) was used and the entityExpression is not a
Constantto anAnyAutomationEntity.Declaration
Swift
var entity: (any HomeObject)? { get } -
The identifier of the
DeviceTypeassociated with theStateReader, if the entity is a device.deviceType will be nil if entity is nil or not a device, such as a
StructureorRoom.Declaration
Swift
var deviceType: (any DeviceType.Type)? { get } -
The string-based identifier for the
DeviceType. If deviceType isUnknownDeviceTypeit will refer to the original deviceTypeID provided.deviceTypeID will be nil if entity is nil or not a device, such as a
StructureorRoom.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: StateReader, rhs: StateReader) -> 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