Contents

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 throws

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