HMEventTrigger
A trigger to activate an action set based on a set of events and optional conditions.
Declaration
class HMEventTriggerOverview
Use an HMEventTrigger object to trigger the execution of a scene when a combination of characteristic or location events and conditions occur. To create an event trigger, first create one or more event objects that fire an event when the specified trigger values are met. For example, you might create an HMCharacteristicEvent that fires when the front door is open. Then, you can use HMEventTrigger convenience methods to create optional predicates that specify conditions that must be met before a scene is executed. For example, you might create a condition that ensures the scene is executed only after sunset.
Topics
Creating an event trigger
Querying trigger activation state
Setting trigger events
eventsupdateEvents(_:completionHandler:)Location eventsTime eventsCharacteristic eventsPresence eventsHMEvent
Restoring the previous scene after an event
Controlling recurrence
recurrencesupdateRecurrences(_:completionHandler:)executeOnceupdateExecuteOnce(_:completionHandler:)
Adding a trigger condition
Creating predicates
predicateForEvaluatingTriggerOccurring(beforeSignificantEvent:)predicateForEvaluatingTriggerOccurring(afterSignificantEvent:)predicate(forEvaluatingTriggerOccurringBetweenSignificantEvent:secondSignificantEvent:)predicateForEvaluatingTrigger(occurringBefore:)predicateForEvaluatingTrigger(occurringOn:)predicateForEvaluatingTrigger(occurringAfter:)predicateForEvaluatingTriggerOccurringBetweenDate(with:secondDateWith:)predicateForEvaluatingTrigger(_:relatedBy:toValue:)predicateForEvaluatingTrigger(withPresence:)HMCharacteristicKeyPathHMCharacteristicValueKeyPathHMPresenceKeyPath
Deprecated symbols
addEvent(_:completionHandler:)removeEvent(_:completionHandler:)predicateForEvaluatingTrigger(occurringBefore:applyingOffset:)predicateForEvaluatingTrigger(occurringAfter:applyingOffset:)