Protocol

HMHomeManagerDelegate

An interface the home manager uses to communicate changes to the state of the home network.

Declaration

@protocol HMHomeManagerDelegate

Overview

Adopt this protocol to find out about changes made outside your app to the set of homes in the HomeKit database, like when homes are added or removed by another app. You also rely on this protocol when you first create an HMHomeManager instance. The home manager calls the homeManagerDidUpdateHomes: method to indicate that it has finished its initial load of data from the HomeKit database.

Changes that your app initiates—even those made asynchronously followed by a call to a completion handler—generate delegate callbacks in other apps, but not in your own. As a result, your app must update its internal data store or user interface from both the completion handler of an asynchronous call, and the delegate callback that corresponds to the same kind of change made by another app.

To be alerted about changes made within a particular home, adopt the HMHomeDelegate protocol. To find out about changes made to specific accessories, adopt the HMAccessoryDelegate protocol.

Topics

Adding and Removing Homes

- homeManagerDidUpdateHomes:

Tells the delegate that the home manager updated its collection of homes.

- homeManager:didAddHome:

Tells the delegate that the home manager added a home.

- homeManager:didRemoveHome:

Tells the delegate that the home manager removed a home.

- homeManagerDidUpdatePrimaryHome:

Tells the delegate that the home manager updated its primary home.

Adding Accessories

- homeManager:didReceiveAddAccessoryRequest:

Tells the delegate to add an accessory to a home by using a setup payload.

HMAddAccessoryRequest

A request to add an accessory to a particular home.

Monitoring Authorization Status

- homeManager:didUpdateAuthorizationStatus:

Tells the delegate when the authorization status changes.

Relationships

Inherits From

See Also

Keeping Track of Connected Homes

delegate

A delegate that receives updates on the collection of homes.