assignAccessory(_:to:completionHandler:)
Assigns an accessory to a different room.
Declaration
func assignAccessory(_ accessory: HMAccessory, to room: HMRoom, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)func assignAccessory(_ accessory: HMAccessory, to room: HMRoom) async throwsParameters
- 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
nilon success; otherwise, error object indicating the reason for failure.