An HMService object represents a service provided by an accessory.


A single accessory may provide multiple services. Services have characteristics that can be queried to discover their state or modified to cause the accessory to modify its behavior.


Managing Services

var name: String

The name of the service.

func updateName(String, completionHandler: (Error?) -> Void)

Updates the name of the service to the specified string.

var accessory: HMAccessory?

The accessory that provides this service.

var serviceType: String

The type of the service.

var associatedServiceType: String?

The type of the service associated with an outlet or a switch.

func updateAssociatedServiceType(String?, completionHandler: (Error?) -> Void)

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

var characteristics: [HMCharacteristic]

An array of characteristics for the service.


Accessory Service Types

These constants define the service types supported by the HomeKit Accessory Profile.


Inherits From

Conforms To