AutomationPartPath

struct AutomationPartPath
extension AutomationPartPath : Equatable, Hashable, HomeObject, Identifiable, Sendable

A client facing object for representing a device part.

  • Instance-level accessor for an object’s HomeObjectType.

    Declaration

    Swift

    let objectType: HomeObjectType
  • id

    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 DeviceType instances 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 this AutomationPartPath. This array will never be empty, as AutomationPartPath only 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 AutomationPartPath for a given child DeviceType instance.

    Declaration

    Swift

    func automationPart(_ deviceType: any DeviceType) -> AutomationPartPath?

    Parameters

    deviceType

    The child DeviceType instance to find the AutomationPartPath for.

    Return Value

    The AutomationPartPath representing the child device part for the given DeviceType instance, or nil if 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 a and b, a == b implies that a != b is false.

    Declaration

    Swift

    static func == (lhs: AutomationPartPath, rhs: AutomationPartPath) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Hashes the essential components of this value by feeding them into the given hasher.

    Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

    Important

    In your implementation of hash(into:), don’t call finalize() on the hasher instance 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)