Interface ThermostatAccessory

  • All Superinterfaces:
    HomekitAccessory

    public interface ThermostatAccessory
    extends HomekitAccessory
    A thermostat with heating and cooling controls.
    Author:
    Andy Lintner
    • Method Detail

      • getCurrentTemperature

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

        default double getMinCurrentTemperature()
        return the min value for current temperature. overwrite if you want to change the default value.
        Returns:
        min current temperature
      • getMaxCurrentTemperature

        default double getMaxCurrentTemperature()
        return the max value for current temperature. overwrite if you want to change the default value.
        Returns:
        max current temperature
      • getMinStepCurrentTemperature

        default double getMinStepCurrentTemperature()
        return the min step value for current temperature. overwrite if you want to change the default value.
        Returns:
        min step current temperature
      • getTargetTemperature

        java.util.concurrent.CompletableFuture<java.lang.Double> getTargetTemperature()
        Retrieves the target temperature, in celsius degrees.
        Returns:
        a future that will contain the target temperature.
      • setTargetTemperature

        void setTargetTemperature​(java.lang.Double value)
                           throws java.lang.Exception
        Sets the target temperature.
        Parameters:
        value - the target temperature, in celsius degrees.
        Throws:
        java.lang.Exception - when the temperature cannot be changed.
      • getMinTargetTemperature

        default double getMinTargetTemperature()
        return the min value for target temperature. overwrite if you want to change the default value.
        Returns:
        min target temperature
      • getMaxTargetTemperature

        default double getMaxTargetTemperature()
        return the max value for target temperature. overwrite if you want to change the default value.
        Returns:
        max target temperature
      • getMinStepTargetTemperature

        default double getMinStepTargetTemperature()
        return the min step value for target temperature. overwrite if you want to change the default value.
        Returns:
        min step target temperature
      • getTemperatureDisplayUnit

        java.util.concurrent.CompletableFuture<TemperatureDisplayUnitEnum> getTemperatureDisplayUnit()
        Retrieves the temperture display units, e.g. C or F.
        Returns:
        a future that will contain the temperature unit.
      • setTemperatureDisplayUnit

        void setTemperatureDisplayUnit​(TemperatureDisplayUnitEnum value)
                                throws java.lang.Exception
        Sets the temperature unit.
        Parameters:
        value - the temperature display unit.
        Throws:
        java.lang.Exception - when the temperature cannot be changed.
      • subscribeTargetTemperature

        void subscribeTargetTemperature​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the target temperature.
        Parameters:
        callback - the function to call when the state changes.
      • subscribeTemperatureDisplayUnit

        void subscribeTemperatureDisplayUnit​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the temperature display unit.
        Parameters:
        callback - the function to call when the uni changes.
      • subscribeCurrentTemperature

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

        void unsubscribeCurrentState()
        Unsubscribes from changes in the mode of the thermostat.
      • unsubscribeTargetState

        void unsubscribeTargetState()
        Unsubscribes from changes in the pending, but not yet complete, TargetHeatingCoolingStateEnum of the thermostat.
      • unsubscribeCurrentTemperature

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

        void unsubscribeTemperatureDisplayUnit()
        Unsubscribes from changes in temperature display unit
      • unsubscribeTargetTemperature

        void unsubscribeTargetTemperature()
        Unsubscribes from changes in the target temperature.
      • getCurrentHeatingCoolingStateValidValues

        default CurrentHeatingCoolingStateEnum[] getCurrentHeatingCoolingStateValidValues()
        Valid values for current state.
        Returns:
        array of valid current states.
      • getTargetHeatingCoolingStateValidValues

        default TargetHeatingCoolingStateEnum[] getTargetHeatingCoolingStateValidValues()
        Valid values for target state.
        Returns:
        array of valid targe states.
      • 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.