DeviceGroup

struct DeviceGroup
extension DeviceGroup : Equatable, HasParts, Hashable, HomeEntity, HomeEntityImpl, HomeObject, HomeObjectImpl, Identifiable, ObjectDataRepresentable, Sendable, SendableMetatype

A group of smart home devices that can be controlled together.

  • The object type of this entity.

    Declaration

    Swift

    let objectType: HomeObjectType
  • id

    The ID of this device group.

    Declaration

    Swift

    let id: String
  • Controller for dynamically reading and subscribing to traits on this device group.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is experimental and is subject to change.")
    let traits: any TraitController
  • A controller that provides access to the types supported by this group.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `HasParts` protocol methods instead.")
    let types: DeviceTypeController
  • Information about the connectivity of this group.

    Declaration

    Swift

    var sourceConnectivity: SourceConnectivity
  • Returns the first instance of the given type if the entity supports it, otherwise returns nil.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is experimental and is subject to change.")
    func part<T>(_ part: T.Type = T.self) async -> T? where T : DeviceType
  • Returns an array of the top-level parts matching the given type.

    Throws

    An error if retrieving or communicating with the underlying parts fails.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is experimental and is subject to change.")
    func parts<T>(_ part: T.Type = T.self) async throws -> [T] where T : DeviceType
  • 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: DeviceGroup, rhs: DeviceGroup) -> 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)