Instance Method

assignAccessory:toRoom:completionHandler:

Assigns an accessory to a different room.

Declaration

- (void)assignAccessory:(HMAccessory *)accessory toRoom:(HMRoom *)room completionHandler:(void (^)(NSError *error))completion;

Parameters

accessory

The accessory to assign; must already have been added to the home.

room

The room to which the accessory will be assigned; must already exist in the home.

completion

The block executed after the request is processed.

error

nil on success; otherwise, error object indicating the reason for failure.

See Also

Managing Accessories

accessories

The collection of accessories that are part of the home.

- addAndSetupAccessoriesWithCompletionHandler:

Finds and adds nearby accessories to the home.

- addAndSetupAccessoriesWithPayload:completionHandler:

Finds and adds nearby accessories to the home using a HomeKit code provided by your app.

- addAccessory:completionHandler:

Adds a new accessory to the home.

- removeAccessory:completionHandler:

Removes an accessory from the home.

- unblockAccessory:completionHandler:

Unblocks a blocked accessory.

HMAccessory

A home automation accessory, like a garage door opener or a thermostat.