Class

HMAccessory

A home automation accessory in the home, such as a garage door opener or a thermostat.

Overview

Each physical accessory in the home is represented by one and only one accessory object. A single accessory provides one or more services, represented by instances of HMService. You add accessories to a home using HMAccessoryBrowser, and assign them to rooms using HMHome objects.

Topics

Managing Accessory Information

var name: String

The name of the accessory.

var uniqueIdentifier: UUID

A unique identifier for the accessory.

var category: HMAccessoryCategory

Category information for the accessory.

var room: HMRoom?

The room containing the accessory.

var services: [HMService]

An array of services provided by the accessory.

var cameraProfiles: [HMCameraProfile]?

An array of camera profiles implemented by the accessory.

var profiles: [HMAccessoryProfile]

An array of profiles implemented by the accessory.

var isReachable: Bool

A Boolean value indicating if the accessory can be communicated with in the current network environment.

var isBlocked: Bool

A Boolean value indicating whether the accessory is blocked.

var supportsIdentify: Bool

A Boolean value that indicates whether the accessory supports the identify action.

func identify(completionHandler: (Error?) -> Void)

Used to have an accessory identify itself.

var firmwareVersion: String?

The firmware version of the accessory.

var manufacturer: String?

The manufacturer of the accessory.

var model: String?

The model name of the accessory.

var identifier: UUID

A unique identifier for the accessory.

Deprecated

Managing Bridged Accessories

var isBridged: Bool

Boolean that indicates whether the accessory is accessed through a bridge.

var uniqueIdentifiersForBridgedAccessories: [UUID]?

For a bridge accessory, an array of NSUUID objects, each of which represents the unique identifier of the accessory vended by the bridge.

var identifiersForBridgedAccessories: [UUID]?

An array of identifiers for accessories available through a bridge.

Deprecated

Getting and Setting the Delegate

var delegate: HMAccessoryDelegate?

Delegate that receives updates on the state of the accessory.

Relationships

Inherits From

Conforms To

See Also

Discovery and Basic Setup

class HMAccessoryBrowser

A network browser used to discover new accessories.

protocol HMAccessoryBrowserDelegate

A set of methods used to notify an accessory browser delegate of new accessories.

class HMAccessoryProfile

A profile implemented by an accessory.

protocol HMAccessoryDelegate

A set of methods that defines the communication method for state updates from accessories to their delegates.

class HMAccessoryCategory

The primary category for a HomeKit accessory.