Interface ValveAccessory

    • Method Detail

      • getValveActive

        java.util.concurrent.CompletableFuture<ActiveEnum> getValveActive()
        Retrieves the current active state of the valve; Active could mean the valve is open (but not necessarily running), or that the valve is associated with an active watering program (like a watering program) but is not currently running.

        To communicate water is flowing through a valve, inUse should be used.

        Returns:
        a future that will contain the binary state
      • setValveActive

        java.util.concurrent.CompletableFuture<java.lang.Void> setValveActive​(ActiveEnum active)
                                                                       throws java.lang.Exception
        Sets the valve active state
        Parameters:
        active - the binary state to set
        Returns:
        a future that completes when the change is made
        Throws:
        java.lang.Exception - when the change cannot be made
      • subscribeValveActive

        void subscribeValveActive​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the active state of the valve.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeValveActive

        void unsubscribeValveActive()
        Unsubscribes from changes in the valve active state.
      • getValveInUse

        java.util.concurrent.CompletableFuture<InUseEnum> getValveInUse()
        Retrieves the current inUse state of the valve; InUse usually means water is flowing through the valve.

        To communicate water is flowing through a valve, inUse should be used.

        Returns:
        a future that will contain the binary state
      • subscribeValveInUse

        void subscribeValveInUse​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the inUse state of the valve.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeValveInUse

        void unsubscribeValveInUse()
        Unsubscribes from changes in the valve inUse state.
      • getValveType

        java.util.concurrent.CompletableFuture<ValveTypeEnum> getValveType()
        Retrieves the valve type.
        Returns:
        a future that will contain the valve type.
      • subscribeValveType

        void subscribeValveType​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the valveType state of the valve.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeValveType

        void unsubscribeValveType()
        Unsubscribes from changes in the valveType state.
      • 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.