HAServiceDefinition
public struct HAServiceDefinition
A service definition
-
The domain of the service, for example
lightinlight.turn_onDeclaration
Swift
public var domain: HAServicesDomain -
The service, for example
turn_oninlight.turn_onDeclaration
Swift
public var service: HAServicesService -
The pair of domain and service, for example
light.turn_onDeclaration
Swift
public var domainServicePair: String -
The name of the service, for example “Turn On”
Declaration
Swift
public var name: String -
The description of the service
Declaration
Swift
public var description: String -
Available fields of the service call
Declaration
Swift
public var fields: [String : [String : Any]] -
Create with information
Throws
If any required keys are missing in the dataDeclaration
Swift
public init(domain: HAServicesDomain, service: HAServicesService, data: HAData) throwsParameters
domainThe domain
serviceThe service
dataThe data for the definition
-
Create with information
Declaration
Swift
public init( domain: HAServicesDomain, service: HAServicesService, name: String, description: String, fields: [String: [String: Any]] )Parameters
domainThe domain of the service
serviceThe service
nameThe friendly name of the service
descriptionThe description of the service
fieldsAvailable fields in the service call
View on GitHub