Interface HeaterCoolerAccessory

    • Method Detail

      • getCurrentTemperature

        CompletableFuture<Double> getCurrentTemperature()
        Retrieves the current temperature, in celsius degrees.
        Returns:
        a future that will contain the temperature.
      • isActive

        CompletableFuture<Boolean> isActive()
        Mandatory: Retrieves the current active state of the Heater Cooler.
        Returns:
        a future that will contain the binary state
      • setActive

        CompletableFuture<Void> setActive​(boolean state)
                                   throws Exception
        Sets the active state of the Heater Cooler
        Parameters:
        state - the binary state to set
        Returns:
        a future that completes when the change is made
        Throws:
        Exception - when the change cannot be made
      • setTargetHeaterCoolerState

        CompletableFuture<Void> setTargetHeaterCoolerState​(TargetHeaterCoolerStateEnum state)
        set heater cooler target state the lock target state.
        Parameters:
        state - heater cooler target state
        Returns:
        a future that completes when the change is made
      • subscribeCurrentHeaterCoolerState

        void subscribeCurrentHeaterCoolerState​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the heater cooler current state.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeCurrentHeaterCoolerState

        void unsubscribeCurrentHeaterCoolerState()
        Unsubscribes from changes in heater cooler current state.
      • subscribeTargetHeaterCoolerState

        void subscribeTargetHeaterCoolerState​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the heater cooler target state.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeTargetHeaterCoolerState

        void unsubscribeTargetHeaterCoolerState()
        Unsubscribes from changes in heater cooler target state.
      • subscribeActive

        void subscribeActive​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the active state of the heater cooler .
        Parameters:
        callback - the function to call when the active state changes.
      • unsubscribeActive

        void unsubscribeActive()
        Unsubscribes from changes in the active state of the heater cooler .
      • subscribeCurrentTemperature

        void subscribeCurrentTemperature​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the current temperature.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeCurrentTemperature

        void unsubscribeCurrentTemperature()
        Unsubscribes from changes in the current temperature.
      • getCurrentHeaterCoolerStateValidValues

        default CurrentHeaterCoolerStateEnum[] getCurrentHeaterCoolerStateValidValues()
        Valid values for current state.
        Returns:
        array of valid current states
      • getTargetHeaterCoolerStateValidValues

        default TargetHeaterCoolerStateEnum[] getTargetHeaterCoolerStateValidValues()
        Valid values for target state.
        Returns:
        array of valid target states
      • getServices

        default 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.