Protocol

HMHomeDelegate

A set of methods that define the communication method for configuration changes to a home and for the state of executing action sets in the home.

Overview

HomeKit invokes delegate methods to notify your app of changes to the state of the home network. In general, if your app invokes a HomeKit method with a completion handler parameter and the method is successful, the associated delegate message is sent to other HomeKit apps running on the same or remote iOS devices. If your app initiates the change, the delegate message is not sent to your app, so you should add code to both the completion handler and the associated delegate method to reload data and update views as needed. To learn more about how HomeKit uses the delegation design pattern, read About HomeKit Delegation Methods.

Topics

Observing Home Configuration

func homeDidUpdateName(HMHome)

Tells the delegate that a home’s name changed.

func home(HMHome, didAdd: HMAccessory)

Tells the delegate that a home added a new accessory.

func home(HMHome, didUpdate: HMRoom, for: HMAccessory)

Tells the delegate that a home assigned an accessory to a different room.

func home(HMHome, didRemove: HMAccessory)

Tells the delegate that a home removed an accessory.

func home(HMHome, didAdd: HMRoom)

Tells the delegate that a home added a new room.

func home(HMHome, didUpdateNameFor: HMRoom)

Tells the delegate that a home updated the name of one of its rooms.

func home(HMHome, didAdd: HMRoom, to: HMZone)

Tells the delegate that a home added a room to a zone.

func home(HMHome, didRemove: HMRoom, from: HMZone)

Tells the delegate that a home removed a room from a zone.

func home(HMHome, didRemove: HMRoom)

Tells the delegate that a home removed a room.

func home(HMHome, didAdd: HMZone)

Tells the delegate that a home added a new zone.

func home(HMHome, didUpdateNameFor: HMZone)

Tells the delegate that a home changed the name of a zone.

func home(HMHome, didRemove: HMZone)

Tells the delegate that a home removed a zone.

func home(HMHome, didAdd: HMUser)

Tells the delegate that a home added a user.

func home(HMHome, didRemove: HMUser)

Tells the delegate that a home removed a user.

Observing Service Configuration

func home(HMHome, didAdd: HMServiceGroup)

Tells the delegate that a home added a service group.

func home(HMHome, didUpdateNameFor: HMServiceGroup)

Tells the delegate that a home updated the name of a service group.

func home(HMHome, didAdd: HMService, to: HMServiceGroup)

Tells the delegate that a home added a service to a service group.

func home(HMHome, didRemove: HMService, from: HMServiceGroup)

Tells the delegate that a home removed a service from a service group.

func home(HMHome, didRemove: HMServiceGroup)

Tells the delegate that a home removed a service group.

Observing Action and Trigger Configuration

func home(HMHome, didAdd: HMActionSet)

Tells the delegate that a home added an action set.

func home(HMHome, didUpdateNameFor: HMActionSet)

Tells the delegate that a home updated the name of an action set.

func home(HMHome, didUpdateActionsFor: HMActionSet)

Tells the delegate that a home updated the actions for an action set.

func home(HMHome, didRemove: HMActionSet)

Tells the delegate that a home removed an action set.

func home(HMHome, didAdd: HMTrigger)

Tells the delegate that a home added a trigger.

func home(HMHome, didUpdateNameFor: HMTrigger)

Tells the delegate that a home updated the name of a trigger.

func home(HMHome, didUpdate: HMTrigger)

Tells the delegate that a home updated a trigger.

func home(HMHome, didRemove: HMTrigger)

Tells the delegate that a home removed a trigger.

Observing Accessories

func home(HMHome, didEncounterError: Error, for: HMAccessory)

Tells the delegate that a configured accessory encountered an error.

func home(HMHome, didUnblockAccessory: HMAccessory)

Tells the delegate that an accessory has been unblocked.

Relationships

Inherits From

See Also

Getting and Setting the Delegate

var delegate: HMHomeDelegate?

Delegate that receives updates on the state of the home.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software