Contents

updateAssociatedServiceType(_:completionHandler:)

Associates the service type of the plugged-in device with a switch or an outlet service.

Declaration

func updateAssociatedServiceType(_ serviceType: String?, completionHandler completion: @escaping  @Sendable ((any Error)?) -> Void)
func updateAssociatedServiceType(_ serviceType: String?) async throws

Parameters

  • serviceType:

    The service type of the device that is hooked up to the switch or outlet.

  • completion:

    The block executed after the request is processed.

    error

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

Discussion

This method is only valid for services of type HMServiceTypeOutlet or HMServiceTypeSwitch. See associatedServiceType for details of associated service types.

See Also

Associating a secondary service