Contents

findVendorAccessory(hapPublicKey:completionHandler:)

Declaration

func findVendorAccessory(hapPublicKey: Data, completionHandler completion: @escaping  @Sendable (HMAccessory?, (any Error)?) -> Void)
func findVendorAccessory(hapPublicKey: Data) async throws -> HMAccessory?

Parameters

  • hapPublicKey:

    The HAP Long Term Public Key of the accessory. This has a length of 32 bytes. Refer to the HomeKit Accessory Protocol Specification for details.

Discussion

Finds a vendor HAP accessory based on its Long Term Public Key.

If no matching accessory exists, or if the current process does not have vendor-level access to the matching accessory, the result will be nil.

An error will be returned if this method is used before available homes have been retrieved by the HMHomeManager, i.e. before the homeManagerDidUpdateHomes: delegate method has been invoked.