struct AutomationPartPathextension AutomationPartPath : Equatable, Hashable, HomeObject, Identifiable, SendableA client facing object for representing a device part.
-
Instance-level accessor for an object’s HomeObjectType.
Declaration
Swift
let objectType: HomeObjectType -
Per-Home-unique identifier for this object.
Declaration
Swift
let id: String -
The root device of this part.
Declaration
Swift
let rootDevice: HomeDevice -
The path of
DeviceTypeinstances from the top-level part to the part being referenced. The first element in the path represents a part that is a direct child of the root device, and each subsequent element is a child of the previous element. The last element in the array is the specific part being referenced by thisAutomationPartPath. This array will never be empty, asAutomationPartPathonly represents parts of a device, not the root device itself.Declaration
Swift
let path: [any DeviceType] -
The device type for the part this path is referencing.
Declaration
Swift
let deviceType: any DeviceType -
Returns the
AutomationPartPathfor a given childDeviceTypeinstance.Declaration
Swift
func automationPart(_ deviceType: any DeviceType) -> AutomationPartPath?Parameters
deviceTypeThe child
DeviceTypeinstance to find theAutomationPartPathfor.Return Value
The
AutomationPartPathrepresenting the child device part for the givenDeviceTypeinstance, ornilif the device part is not found. -
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: AutomationPartPath, rhs: AutomationPartPath) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. The components used for hashing must be the same as the components compared in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.Important
In your implementation of
hash(into:), don’t callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher)