HomeObject

protocol HomeObject : Hashable, Identifiable, Sendable where Self.ID == String
extension HomeObject : Equatable

Base protocol for all entity classes returned from the GoogleHomeSDK.

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

    Declaration

    Swift

    var objectType: HomeObjectType { get }
  • id

    Per-Home-unique identifier for this object.

    Declaration

    Swift

    override var id: String { get }
  • ==(_:_:)

    Extension method

    Note: By default, object equality is determined by object id.

    Objects conforming to HomeObject should override this function if they have other properties that should be considered in the equality check.

    Declaration

    Swift

    static func == (lhs: Self, rhs: Self) -> Bool
  • hash(into:)

    Extension method

    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)