Package apple.homekit

Class HMEventTrigger

  • All Implemented Interfaces:
    NSObject

    public class HMEventTrigger
    extends HMTrigger
    Triggers based on events. This class represents a trigger that is based on events.
    • Constructor Detail

      • HMEventTrigger

        protected HMEventTrigger​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • predicateForEvaluatingTriggerOccurringAfterDateWithComponents

        public static NSPredicate predicateForEvaluatingTriggerOccurringAfterDateWithComponents​(NSDateComponents dateComponents)
        Creates a predicate that will evaluate whether the event occurred at or after the time specified.
        Parameters:
        dateComponents - Date components representing the time to compare against when the event occurs.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringAfterSignificantEventApplyingOffset

        public static NSPredicate predicateForEvaluatingTriggerOccurringAfterSignificantEventApplyingOffset​(java.lang.String significantEvent,
                                                                                                            NSDateComponents offset)
        Creates a predicate that will evaluate whether the event occurred after a significant event.
        Parameters:
        significantEvent - The significant event to compare against. The valid values are: HMSignificantEventSunrise and HMSignificantEventSunset.
        offset - An offset from the time of the signficant event. To specify an offset after the significant event, the properties of the NSDateComponents must be positive value. e.g. To specify 30 mins after sunset, the 'minute' property must be set to 30.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringBeforeDateWithComponents

        public static NSPredicate predicateForEvaluatingTriggerOccurringBeforeDateWithComponents​(NSDateComponents dateComponents)
        Creates a predicate that will evaluate whether the event occurred before the time specified.
        Parameters:
        dateComponents - Date components representing the time to compare against when the event occurs.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringBeforeSignificantEventApplyingOffset

        public static NSPredicate predicateForEvaluatingTriggerOccurringBeforeSignificantEventApplyingOffset​(java.lang.String significantEvent,
                                                                                                             NSDateComponents offset)
        Creates a predicate that will evaluate whether the event occurred before a significant event.
        Parameters:
        significantEvent - The significant event to compare against. The valid values are: HMSignificantEventSunrise and HMSignificantEventSunset.
        offset - An offset from the time of the signficant event. To specify an offset before the significant event, the properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the 'minute' property must be set to -30.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringOnDateWithComponents

        public static NSPredicate predicateForEvaluatingTriggerOccurringOnDateWithComponents​(NSDateComponents dateComponents)
        Creates a predicate that will evaluate whether the event occurred at the time specified.
        Parameters:
        dateComponents - Date components representing the time to compare against when the event occurs.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerWithCharacteristicRelatedByToValue

        public static NSPredicate predicateForEvaluatingTriggerWithCharacteristicRelatedByToValue​(HMCharacteristic characteristic,
                                                                                                  long operatorType,
                                                                                                  java.lang.Object value)
        Creates a predicate that will evaluate whether a characteristic value is related to the specified value.
        Parameters:
        characteristic - The characteristic that is evaluated as part of the predicate.
        operatorType - The relation between the characteristic and the target value. This can be either Less Than, Greater Than, Less Than or Equal, Greater Than or Equal, Equal, or Not Equal. Anything else will cause an exception to be thrown.
        value - The value of the characteristic to compare when evaluating the predicate.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • addEventCompletionHandler

        public void addEventCompletionHandler​(HMEvent event,
                                              HMEventTrigger.Block_addEventCompletionHandler completion)
        Adds a new event to the event trigger.
        Parameters:
        event - Event to add to the event trigger.
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • events

        public NSArray<? extends HMEvent> events()
        The events associated with the trigger.
      • initWithNameEventsPredicate

        public HMEventTrigger initWithNameEventsPredicate​(java.lang.String name,
                                                          NSArray<? extends HMEvent> events,
                                                          NSPredicate predicate)
        Initializes a new event trigger object.
        Parameters:
        name - Name of the event trigger.
        events - Array of events that can trigger the evaluation of the trigger. Note: The trigger will be evaluated if any one of the events is true.
        predicate - The predicate to evaluate before executing any of the actions sets associated to this event.
        Returns:
        Instance object representing the event trigger.
      • predicate

        public NSPredicate predicate()
        The predicate to evaluate before executing the action sets associated with the trigger.
      • removeEventCompletionHandler

        public void removeEventCompletionHandler​(HMEvent event,
                                                 HMEventTrigger.Block_removeEventCompletionHandler completion)
        Removes the specified event from the event trigger.
        Parameters:
        event - Event to remove from the event trigger.
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • updatePredicateCompletionHandler

        public void updatePredicateCompletionHandler​(NSPredicate predicate,
                                                     HMEventTrigger.Block_updatePredicateCompletionHandler completion)
        This method replaces the predicate used to evaluate execution of the action sets associated with the trigger.
        Parameters:
        predicate - The new predicate for the event trigger.
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • endEvents

        public NSArray<? extends HMEvent> endEvents()
        The events that correspond to executing the restore of the scene before the trigger was executed. E.g. Execute the scene for 10 mins and restore original state is achieved by specifying a corresponding HMDurationEvent in the list of endEvents.
      • executeOnce

        public boolean executeOnce()
        Specifies whether this trigger is executed only once after which the trigger is disabled.
      • initWithNameEventsEndEventsRecurrencesPredicate

        public HMEventTrigger initWithNameEventsEndEventsRecurrencesPredicate​(java.lang.String name,
                                                                              NSArray<? extends HMEvent> events,
                                                                              NSArray<? extends HMEvent> endEvents,
                                                                              NSArray<? extends NSDateComponents> recurrences,
                                                                              NSPredicate predicate)
        Initializes a new event trigger object.
        Parameters:
        name - Name of the event trigger.
        events - Array of events that can trigger the evaluation of the trigger. Note: The trigger will be evaluated if any one of the events is true.
        endEvents - Array of end events that can trigger the restoration to the state before the scene was run.
        recurrences - Specifies the days of the week when the trigger is to be evaluated. Only the 'weekday' property is honored in NSDateComponents.
        predicate - The predicate to evaluate before executing any of the actions sets associated to this event.
        Returns:
        Instance object representing the event trigger.
      • predicateForEvaluatingTriggerOccurringAfterSignificantEvent

        public static NSPredicate predicateForEvaluatingTriggerOccurringAfterSignificantEvent​(HMSignificantTimeEvent significantEvent)
        Creates a predicate that will evaluate whether the event occurred after a significant event.
        Parameters:
        significantEvent - The significant event to compare against.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringBeforeSignificantEvent

        public static NSPredicate predicateForEvaluatingTriggerOccurringBeforeSignificantEvent​(HMSignificantTimeEvent significantEvent)
        Creates a predicate that will evaluate whether the event occurred before a significant event.
        Parameters:
        significantEvent - The significant event to compare against.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringBetweenDateWithComponentsSecondDateWithComponents

        public static NSPredicate predicateForEvaluatingTriggerOccurringBetweenDateWithComponentsSecondDateWithComponents​(NSDateComponents firstDateComponents,
                                                                                                                          NSDateComponents secondDateWithComponents)
        Creates a predicate that will evaluate whether the event occurred between two times.
        Parameters:
        firstDateComponents - The first date component.
        secondDateWithComponents - The second date component.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerOccurringBetweenSignificantEventSecondSignificantEvent

        public static NSPredicate predicateForEvaluatingTriggerOccurringBetweenSignificantEventSecondSignificantEvent​(HMSignificantTimeEvent firstSignificantEvent,
                                                                                                                      HMSignificantTimeEvent secondSignificantEvent)
        Creates a predicate that will evaluate whether the event occurred between two significant events.
        Parameters:
        firstSignificantEvent - The first significant event.
        secondSignificantEvent - The second significant event.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • predicateForEvaluatingTriggerWithPresence

        public static NSPredicate predicateForEvaluatingTriggerWithPresence​(HMPresenceEvent presenceEvent)
        Creates a predicate that will evaluate based on the presence event.
        Parameters:
        presenceEvent - The presenceEvent that is evaluated as part of the predicate.
        Returns:
        Predicate object representing a condition to evaluate before executing the action set.
      • recurrences

        public NSArray<? extends NSDateComponents> recurrences()
        recurrences Specifies the recurrences for when the trigger is evaluated. This only supports days of the week.
      • triggerActivationState

        public long triggerActivationState()
        Specifies the current activation state of the trigger.
      • updateEndEventsCompletionHandler

        public void updateEndEventsCompletionHandler​(NSArray<? extends HMEvent> endEvents,
                                                     HMEventTrigger.Block_updateEndEventsCompletionHandler completion)
        Updates the set of events in the event trigger.
        Parameters:
        endEvents - Events to update in the event trigger
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • updateEventsCompletionHandler

        public void updateEventsCompletionHandler​(NSArray<? extends HMEvent> events,
                                                  HMEventTrigger.Block_updateEventsCompletionHandler completion)
        Updates the set of events in the event trigger.
        Parameters:
        events - Events to update in the event trigger
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • updateExecuteOnceCompletionHandler

        public void updateExecuteOnceCompletionHandler​(boolean executeOnce,
                                                       HMEventTrigger.Block_updateExecuteOnceCompletionHandler completion)
        This method is used to update whether the event trigger repeats or not.
        Parameters:
        executeOnce - Specifies whether the event trigger is repeated or not.
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.
      • updateRecurrencesCompletionHandler

        public void updateRecurrencesCompletionHandler​(NSArray<? extends NSDateComponents> recurrences,
                                                       HMEventTrigger.Block_updateRecurrencesCompletionHandler completion)
        This method replaces the recurrences which secifies the days of the week when the trigger is to be evaluated.
        Parameters:
        recurrences - The new recurrences for the event trigger.
        completion - Block that is invoked once the request is processed. The NSError provides more information on the status of the request, error will be nil on success.