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. API-Since: 9.0
    • Constructor Detail

      • HMEventTrigger

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

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

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

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

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

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

        @NotNull
        public static @NotNull 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

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • predicateForEvaluatingTriggerOccurringAfterDateWithComponents

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringAfterDateWithComponents​(@NotNull
                                                                                                         @NotNull 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

        @NotNull
        @Deprecated
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringAfterSignificantEventApplyingOffset​(@NotNull
                                                                                                                     @NotNull java.lang.String significantEvent,
                                                                                                                     @Nullable
                                                                                                                     @Nullable NSDateComponents offset)
        Deprecated.
        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. API-Since: 9.0 Deprecated-Since: 11.0 Deprecated-Message: Use predicateForEvaluatingTriggerOccurringAfterSignificantEvent: instead
      • predicateForEvaluatingTriggerOccurringBeforeDateWithComponents

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringBeforeDateWithComponents​(@NotNull
                                                                                                          @NotNull 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

        @NotNull
        @Deprecated
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringBeforeSignificantEventApplyingOffset​(@NotNull
                                                                                                                      @NotNull java.lang.String significantEvent,
                                                                                                                      @Nullable
                                                                                                                      @Nullable NSDateComponents offset)
        Deprecated.
        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. API-Since: 9.0 Deprecated-Since: 11.0 Deprecated-Message: Use predicateForEvaluatingTriggerOccurringBeforeSignificantEvent: instead
      • predicateForEvaluatingTriggerOccurringOnDateWithComponents

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringOnDateWithComponents​(@NotNull
                                                                                                      @NotNull 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

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerWithCharacteristicRelatedByToValue​(@NotNull
                                                                                                           @NotNull HMCharacteristic characteristic,
                                                                                                           long operatorType,
                                                                                                           @NotNull
                                                                                                           @NotNull 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

        @Deprecated
        public void addEventCompletionHandler​(@NotNull
                                              @NotNull HMEvent event,
                                              @NotNull
                                              @NotNull HMEventTrigger.Block_addEventCompletionHandler completion)
        Deprecated.
        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. API-Since: 9.0 Deprecated-Since: 11.0 Deprecated-Message: Use updateEvents:completionHandler: instead
      • events

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

        public HMEventTrigger initWithNameEventsPredicate​(@NotNull
                                                          @NotNull java.lang.String name,
                                                          @NotNull
                                                          @NotNull NSArray<? extends HMEvent> events,
                                                          @Nullable
                                                          @Nullable 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

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

        @Deprecated
        public void removeEventCompletionHandler​(@NotNull
                                                 @NotNull HMEvent event,
                                                 @NotNull
                                                 @NotNull HMEventTrigger.Block_removeEventCompletionHandler completion)
        Deprecated.
        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. API-Since: 9.0 Deprecated-Since: 11.0 Deprecated-Message: Use updateEvents:completionHandler: instead
      • updatePredicateCompletionHandler

        public void updatePredicateCompletionHandler​(@Nullable
                                                     @Nullable NSPredicate predicate,
                                                     @NotNull
                                                     @NotNull 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

        @NotNull
        public @NotNull 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. API-Since: 11.0
      • executeOnce

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

        public HMEventTrigger initWithNameEventsEndEventsRecurrencesPredicate​(@NotNull
                                                                              @NotNull java.lang.String name,
                                                                              @NotNull
                                                                              @NotNull NSArray<? extends HMEvent> events,
                                                                              @Nullable
                                                                              @Nullable NSArray<? extends HMEvent> endEvents,
                                                                              @Nullable
                                                                              @Nullable NSArray<? extends NSDateComponents> recurrences,
                                                                              @Nullable
                                                                              @Nullable 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. API-Since: 11.0
      • predicateForEvaluatingTriggerOccurringAfterSignificantEvent

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringAfterSignificantEvent​(@NotNull
                                                                                                       @NotNull 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. API-Since: 11.0
      • predicateForEvaluatingTriggerOccurringBeforeSignificantEvent

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringBeforeSignificantEvent​(@NotNull
                                                                                                        @NotNull 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. API-Since: 11.0
      • predicateForEvaluatingTriggerOccurringBetweenDateWithComponentsSecondDateWithComponents

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringBetweenDateWithComponentsSecondDateWithComponents​(@NotNull
                                                                                                                                   @NotNull NSDateComponents firstDateComponents,
                                                                                                                                   @NotNull
                                                                                                                                   @NotNull 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. API-Since: 11.0
      • predicateForEvaluatingTriggerOccurringBetweenSignificantEventSecondSignificantEvent

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerOccurringBetweenSignificantEventSecondSignificantEvent​(@NotNull
                                                                                                                               @NotNull HMSignificantTimeEvent firstSignificantEvent,
                                                                                                                               @NotNull
                                                                                                                               @NotNull 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. API-Since: 11.0
      • predicateForEvaluatingTriggerWithPresence

        @NotNull
        public static @NotNull NSPredicate predicateForEvaluatingTriggerWithPresence​(@NotNull
                                                                                     @NotNull 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. API-Since: 11.0
      • recurrences

        @Nullable
        public @Nullable NSArray<? extends NSDateComponents> recurrences()
        recurrences Specifies the recurrences for when the trigger is evaluated. This only supports days of the week. API-Since: 11.0
      • triggerActivationState

        public long triggerActivationState()
        Specifies the current activation state of the trigger. API-Since: 11.0
      • updateEndEventsCompletionHandler

        public void updateEndEventsCompletionHandler​(@NotNull
                                                     @NotNull NSArray<? extends HMEvent> endEvents,
                                                     @NotNull
                                                     @NotNull 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. API-Since: 11.0
      • updateEventsCompletionHandler

        public void updateEventsCompletionHandler​(@NotNull
                                                  @NotNull NSArray<? extends HMEvent> events,
                                                  @NotNull
                                                  @NotNull 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. API-Since: 11.0
      • updateExecuteOnceCompletionHandler

        public void updateExecuteOnceCompletionHandler​(boolean executeOnce,
                                                       @NotNull
                                                       @NotNull 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. API-Since: 11.0
      • updateRecurrencesCompletionHandler

        public void updateRecurrencesCompletionHandler​(@Nullable
                                                       @Nullable NSArray<? extends NSDateComponents> recurrences,
                                                       @NotNull
                                                       @NotNull 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. API-Since: 11.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.