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 currentCurrentHeatingCoolingStateEnum
of the thermostat.java.util.concurrent.CompletableFuture<java.lang.Double>
getCurrentTemperature()
Retrieves the current temperature, in celsius degrees.default double
getMaxCurrentTemperature()
return the max value for current temperature.default double
getMaxTargetTemperature()
return the max value for target temperature.default double
getMinCurrentTemperature()
return the min value for current temperature.default double
getMinStepCurrentTemperature()
return the min step value for current temperature.default double
getMinStepTargetTemperature()
return the min step value for target temperature.default double
getMinTargetTemperature()
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,TargetHeatingCoolingStateEnum
of 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.void
setTargetState(TargetHeatingCoolingStateEnum mode)
Sets theTargetHeatingCoolingStateEnum
of the thermostat.void
setTargetTemperature(java.lang.Double value)
Sets the target temperature.void
setTemperatureDisplayUnit(TemperatureDisplayUnitEnum value)
Sets the temperature unit.void
subscribeCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in theCurrentHeatingCoolingStateEnum
of the thermostat.void
subscribeCurrentTemperature(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current temperature.void
subscribeTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the pending, but not yet complete,TargetHeatingCoolingStateEnum
of the thermostat.void
subscribeTargetTemperature(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target temperature.void
subscribeTemperatureDisplayUnit(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the temperature display unit.void
unsubscribeCurrentState()
Unsubscribes from changes in the mode of the thermostat.void
unsubscribeCurrentTemperature()
Unsubscribes from changes in the current temperature.void
unsubscribeTargetState()
Unsubscribes from changes in the pending, but not yet complete,TargetHeatingCoolingStateEnum
of the thermostat.void
unsubscribeTargetTemperature()
Unsubscribes from changes in the target temperature.void
unsubscribeTemperatureDisplayUnit()
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.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
-
getCurrentState
java.util.concurrent.CompletableFuture<CurrentHeatingCoolingStateEnum> getCurrentState()
Retrieves the currentCurrentHeatingCoolingStateEnum
of the thermostat.- Returns:
- a future that will contain the mode.
-
setTargetState
void setTargetState(TargetHeatingCoolingStateEnum mode) throws java.lang.Exception
Sets theTargetHeatingCoolingStateEnum
of the thermostat.- Parameters:
mode
- TheTargetHeatingCoolingStateEnum
to 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,TargetHeatingCoolingStateEnum
of 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,TargetHeatingCoolingStateEnum
of 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 theCurrentHeatingCoolingStateEnum
of 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,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 interfaceHomekitAccessory
- Returns:
- the collection of services.
-
-