Interface DoorAccessory

    • Method Detail

      • getPositionState

        java.util.concurrent.CompletableFuture<PositionStateEnum> getPositionState()
        Retrieves the position state of the door
        Returns:
        a future which will contain the door's position state
      • getCurrentPosition

        java.util.concurrent.CompletableFuture<java.lang.Integer> getCurrentPosition()
        Retrieves the current position of the door
        Returns:
        a future which will contain the door's current position
      • getTargetPosition

        java.util.concurrent.CompletableFuture<java.lang.Integer> getTargetPosition()
        Retrieves the target position of the door
        Returns:
        a future which will contain the door's target position
      • setTargetPosition

        java.util.concurrent.CompletableFuture<java.lang.Void> setTargetPosition​(java.lang.Integer position)
                                                                          throws java.lang.Exception
        Sets the targeted state of the door.
        Parameters:
        position - the targeted position
        Returns:
        a future that completes when the change is made
        Throws:
        java.lang.Exception - when the change cannot be made
      • subscribePositionState

        void subscribePositionState​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the door's position state
        Parameters:
        callback - the function to call when the state changes
      • subscribeCurrentPosition

        void subscribeCurrentPosition​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the door's current position
        Parameters:
        callback - the function to call when the current position changes
      • subscribeTargetPosition

        void subscribeTargetPosition​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the door's target position
        Parameters:
        callback - the function to call when the target position changes
      • unsubscribePositionState

        void unsubscribePositionState()
        Unsubscribes from changes in the door's state
      • unsubscribeCurrentPosition

        void unsubscribeCurrentPosition()
        Unsubscribes from changes in the door's current position
      • unsubscribeTargetPosition

        void unsubscribeTargetPosition()
        Unsubscribes from changes in the door's target position
      • getServices

        default java.util.Collection<Service> getServices()
        Description copied from interface: HomekitAccessory
        The collection of Services this accessory supports. Services are the primary way to interact with the accessory via HomeKit. Besides the Services offered here, the accessory will automatically include the required information service.

        This method will only be useful if you're implementing your own accessory type. For the standard accessories, use the default implementation provided by the interfaces in io.github.hapjava.accessories.

        Specified by:
        getServices in interface HomekitAccessory
        Returns:
        the collection of services.