Package apple.homekit

Class HMAccessory

  • All Implemented Interfaces:
    NSObject

    public class HMAccessory
    extends NSObject
    Represent an accessory in the home. This class represents an accessory in the home. There is a one to one relationship between a physical accessory and an object of this class. An accessory is composed of one or more services. API-Since: 8.0
    • Constructor Detail

      • HMAccessory

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static HMAccessory 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)
      • 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()
      • cameraProfiles

        @Nullable
        public @Nullable NSArray<? extends HMCameraProfile> cameraProfiles()
        Returns array of camera profiles implemented by the accessory. An accessory can contain one or more cameras. Each camera is represented as a an HMCameraProfile object. If the accessory does not contain a camera, this property will be nil. API-Since: 10.0
      • category

        @NotNull
        public @NotNull HMAccessoryCategory category()
        Category information for the accessory. API-Since: 9.0
      • delegate

        @Nullable
        public @Nullable HMAccessoryDelegate delegate()
        Delegate object that receives updates on the state of the accessory.
      • identifier

        @NotNull
        @Deprecated
        public @NotNull NSUUID identifier()
        Deprecated.
        A unique identifier for the accessory. Use uniqueIdentifier to obtain the identifier for this object. API-Since: 8.0 Deprecated-Since: 9.0 Deprecated-Message: No longer supported.
      • identifiersForBridgedAccessories

        @Nullable
        @Deprecated
        public @Nullable NSArray<? extends NSUUID> identifiersForBridgedAccessories()
        Deprecated.
        If this accessory is a bridge, this property is an array of NSUUID objects that, each of which represents the 'uniqueIdentifier' of the accessory vended by the bridge. Use uniqueIdentifiersForBridgedAccessories to obtain the identifiers for the bridged accessories. API-Since: 8.0 Deprecated-Since: 9.0 Deprecated-Message: No longer supported.
      • identifyWithCompletionHandler

        public void identifyWithCompletionHandler​(@NotNull
                                                  @NotNull HMAccessory.Block_identifyWithCompletionHandler completion)
        This method is used to have an accessory identify itself.
        Parameters:
        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.
      • isBlocked

        public boolean isBlocked()
        TRUE if the accessory is blocked, FALSE otherwise.
      • isBridged

        public boolean isBridged()
        This property indicates whether this accessory is behind a bridge. If it is TRUE, the accessory cannot be removed from the home directly. Only the bridge that owns this accessory can be removed and removing the bridge will remove this accessory from the home.
      • isReachable

        public boolean isReachable()
        TRUE if the accessory is currently reachable, FALSE otherwise.
      • name

        @NotNull
        public @NotNull java.lang.String name()
        The name of the accessory. Returns the accessory's name that is associated with HomeKit. The initial value is the name provided by the accessory information service of the accessory.
      • room

        @Nullable
        public @Nullable HMRoom room()
        Room containing the accessory.
      • services

        @NotNull
        public @NotNull NSArray<? extends HMService> services()
        Array of HMService objects that represent all the services provided by the accessory.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(@Nullable
                                       @Nullable HMAccessoryDelegate value)
        Delegate object that receives updates on the state of the accessory.
      • setDelegate

        public void setDelegate​(@Nullable
                                @Nullable HMAccessoryDelegate value)
        Delegate object that receives updates on the state of the accessory.
      • uniqueIdentifier

        @NotNull
        public @NotNull NSUUID uniqueIdentifier()
        A unique identifier for the accessory. API-Since: 9.0
      • uniqueIdentifiersForBridgedAccessories

        @Nullable
        public @Nullable NSArray<? extends NSUUID> uniqueIdentifiersForBridgedAccessories()
        If this accessory is a bridge, this property is an array of NSUUID objects that, each of which represents the 'uniqueIdentifier' of the accessory vended by the bridge. An accessory can be standalone, a bridge, or hosted behind a bridge. - A standalone accessory would have its 'bridged' property set to FALSE and its 'uniqueIdentifiersForBridgedAccessories' property set to nil. - An accessory that is a bridge would have its 'bridged' property set to FALSE, but have a non-empty 'uniqueIdentifiersForBridgedAccessories' property. - An accessory behind a bridge would have its 'bridged' property set to TRUE and its 'uniqueIdentifiersForBridgedAccessories' property set to nil. API-Since: 9.0
      • updateNameCompletionHandler

        public void updateNameCompletionHandler​(@NotNull
                                                @NotNull java.lang.String name,
                                                @NotNull
                                                @NotNull HMAccessory.Block_updateNameCompletionHandler completion)
        This method is used to change the name of the accessory. The new name is stored in HomeKit and not on the accessory.
        Parameters:
        name - New name for the accessory.
        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.
      • firmwareVersion

        @Nullable
        public @Nullable java.lang.String firmwareVersion()
        Accessory's firmware version. API-Since: 11.0
      • manufacturer

        @Nullable
        public @Nullable java.lang.String manufacturer()
        Manufacturer of the accessory. API-Since: 11.0
      • model

        @Nullable
        public @Nullable java.lang.String model()
        Model of the accessory. API-Since: 11.0
      • profiles

        @NotNull
        public @NotNull NSArray<? extends HMAccessoryProfile> profiles()
        Accessory profiles of the receiver. API-Since: 11.0
      • supportsIdentify

        public boolean supportsIdentify()
        Indicates if the accessory supports the identify action. API-Since: 11.3
      • matterNodeID

        @Nullable
        public @Nullable NSNumber matterNodeID()
        The node identifier used to identify the device on Apple’s Matter fabric. API-Since: 16.1
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.