An abstract base class for triggering actions based on a set of conditions.


class HMTrigger : NSObject


This class defines the basic behavior of triggers, but does not itself specify any criteria for firing a trigger. Use instances of subclasses of HMTrigger to set up concrete triggers for actions.


Managing Triggers

var name: String

The name of the trigger.

var isEnabled: Bool

State of the trigger.

func enable(Bool, completionHandler: (Error?) -> Void)

Changes the enabled state of the trigger.

var lastFireDate: Date?

The last time this trigger fired.

var uniqueIdentifier: UUID

A unique identifier for this trigger.

Managing Action Sets

var actionSets: [HMActionSet]

Array of all action sets that will be executed by the trigger.


Inherits From

Conforms To

See Also

Triggering an Action Set

var triggers: [HMTrigger]

An array of triggers defined in the home.

class HMTimerTrigger

A trigger to activate an action set based on a periodic timer.

class HMEventTrigger

A trigger to activate an action set based on a set of events and optional conditions.