Instance Method

addService(_:completionHandler:)

Adds a new service to the service group.

Declaration

func addService(_ service: HMService, completionHandler completion: @escaping (Error?) -> Void)

Parameters

service

The service to add.

completion

The block executed after the request is processed.

error

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

Discussion

A service can be added to multiple service groups. For example, a light could be added to the “Desk Lamps” service group as well as the “Dimmable Lights” service group.

See Also

Managing Service Groups

var name: String

The name of the service group.

var uniqueIdentifier: UUID

The unique identifier for the service group.

var services: [HMService]

Array of the services in the service group.