Instance Method

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 (Error?) -> Void)

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

Reading Service Properties

var isPrimaryService: Bool

A Boolean value that indicates whether this service is the primary service on the accessory.

var isUserInteractive: Bool

A Boolean value that indicates whether this service supports user interaction.