addTrigger(_:completionHandler:)
Adds a trigger to the home.
Declaration
func addTrigger(_ trigger: HMTrigger, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)func addTrigger(_ trigger: HMTrigger) async throwsParameters
- trigger:
The name of the new trigger. Must not be
nil, and must not be the name of a trigger already in the home. - completion:
The block executed after the request is processed.
- trigger
The newly created trigger.
- error
nilon success; otherwise, error object indicating the reason for failure.