Package io.github.hapjava.accessories
Interface ThermostatAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface ThermostatAccessory extends HomekitAccessory
A thermostat with heating and cooling controls.- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CurrentHeatingCoolingStateEnum[]getCurrentHeatingCoolingStateValidValues()Valid values for current state.java.util.concurrent.CompletableFuture<CurrentHeatingCoolingStateEnum>getCurrentState()Retrieves the currentCurrentHeatingCoolingStateEnumof the thermostat.java.util.concurrent.CompletableFuture<java.lang.Double>getCurrentTemperature()Retrieves the current temperature, in celsius degrees.default doublegetMaxCurrentTemperature()return the max value for current temperature.default doublegetMaxTargetTemperature()return the max value for target temperature.default doublegetMinCurrentTemperature()return the min value for current temperature.default doublegetMinStepCurrentTemperature()return the min step value for current temperature.default doublegetMinStepTargetTemperature()return the min step value for target temperature.default doublegetMinTargetTemperature()return the min value for target temperature.default java.util.Collection<Service>getServices()The collection of Services this accessory supports.default TargetHeatingCoolingStateEnum[]getTargetHeatingCoolingStateValidValues()Valid values for target state.java.util.concurrent.CompletableFuture<TargetHeatingCoolingStateEnum>getTargetState()Retrieves the pending, but not yet complete,TargetHeatingCoolingStateEnumof the thermostat.java.util.concurrent.CompletableFuture<java.lang.Double>getTargetTemperature()Retrieves the target temperature, in celsius degrees.java.util.concurrent.CompletableFuture<TemperatureDisplayUnitEnum>getTemperatureDisplayUnit()Retrieves the temperture display units, e.g.voidsetTargetState(TargetHeatingCoolingStateEnum mode)Sets theTargetHeatingCoolingStateEnumof the thermostat.voidsetTargetTemperature(java.lang.Double value)Sets the target temperature.voidsetTemperatureDisplayUnit(TemperatureDisplayUnitEnum value)Sets the temperature unit.voidsubscribeCurrentState(HomekitCharacteristicChangeCallback callback)Subscribes to changes in theCurrentHeatingCoolingStateEnumof the thermostat.voidsubscribeCurrentTemperature(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the current temperature.voidsubscribeTargetState(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the pending, but not yet complete,TargetHeatingCoolingStateEnumof the thermostat.voidsubscribeTargetTemperature(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the target temperature.voidsubscribeTemperatureDisplayUnit(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the temperature display unit.voidunsubscribeCurrentState()Unsubscribes from changes in the mode of the thermostat.voidunsubscribeCurrentTemperature()Unsubscribes from changes in the current temperature.voidunsubscribeTargetState()Unsubscribes from changes in the pending, but not yet complete,TargetHeatingCoolingStateEnumof the thermostat.voidunsubscribeTargetTemperature()Unsubscribes from changes in the target temperature.voidunsubscribeTemperatureDisplayUnit()Unsubscribes from changes in temperature display unit-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
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.ExceptionSets 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
-
getCurrentState
java.util.concurrent.CompletableFuture<CurrentHeatingCoolingStateEnum> getCurrentState()
Retrieves the currentCurrentHeatingCoolingStateEnumof the thermostat.- Returns:
- a future that will contain the mode.
-
setTargetState
void setTargetState(TargetHeatingCoolingStateEnum mode) throws java.lang.Exception
Sets theTargetHeatingCoolingStateEnumof the thermostat.- Parameters:
mode- TheTargetHeatingCoolingStateEnumto set.- Throws:
java.lang.Exception- when the change cannot be made.
-
getTargetState
java.util.concurrent.CompletableFuture<TargetHeatingCoolingStateEnum> getTargetState()
Retrieves the pending, but not yet complete,TargetHeatingCoolingStateEnumof the thermostat.- Returns:
- a future that will contain the target mode.
-
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.
-
subscribeTargetState
void subscribeTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the pending, but not yet complete,TargetHeatingCoolingStateEnumof the thermostat.- Parameters:
callback- the function to call when the state changes.
-
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.
-
subscribeCurrentState
void subscribeCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in theCurrentHeatingCoolingStateEnumof the thermostat.- 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,TargetHeatingCoolingStateEnumof 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:HomekitAccessoryThe 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:
getServicesin interfaceHomekitAccessory- Returns:
- the collection of services.
-
-