Package io.github.hapjava.accessories
Interface HeaterCoolerAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface HeaterCoolerAccessory extends HomekitAccessory
Heater Cooler accessory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentHeaterCoolerStateEnum>
getCurrentHeaterCoolerState()
Retrieves the heater /cooler current state.default CurrentHeaterCoolerStateEnum[]
getCurrentHeaterCoolerStateValidValues()
Valid values for current state.java.util.concurrent.CompletableFuture<java.lang.Double>
getCurrentTemperature()
Retrieves the current temperature, in celsius degrees.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetHeaterCoolerStateEnum>
getTargetHeaterCoolerState()
Retrieves the heater cooler target state.default TargetHeaterCoolerStateEnum[]
getTargetHeaterCoolerStateValidValues()
Valid values for target state.java.util.concurrent.CompletableFuture<java.lang.Boolean>
isActive()
Mandatory: Retrieves the current active state of the Heater Cooler.java.util.concurrent.CompletableFuture<java.lang.Void>
setActive(boolean state)
Sets the active state of the Heater Coolerjava.util.concurrent.CompletableFuture<java.lang.Void>
setTargetHeaterCoolerState(TargetHeaterCoolerStateEnum state)
set heater cooler target state the lock target state.void
subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the heater cooler .void
subscribeCurrentHeaterCoolerState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the heater cooler current state.void
subscribeCurrentTemperature(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current temperature.void
subscribeTargetHeaterCoolerState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the heater cooler target state.void
unsubscribeActive()
Unsubscribes from changes in the active state of the heater cooler .void
unsubscribeCurrentHeaterCoolerState()
Unsubscribes from changes in heater cooler current state.void
unsubscribeCurrentTemperature()
Unsubscribes from changes in the current temperature.void
unsubscribeTargetHeaterCoolerState()
Unsubscribes from changes in heater cooler target state.-
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.
-
isActive
java.util.concurrent.CompletableFuture<java.lang.Boolean> isActive()
Mandatory: Retrieves the current active state of the Heater Cooler.- Returns:
- a future that will contain the binary state
-
setActive
java.util.concurrent.CompletableFuture<java.lang.Void> setActive(boolean state) throws java.lang.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:
java.lang.Exception
- when the change cannot be made
-
getCurrentHeaterCoolerState
java.util.concurrent.CompletableFuture<CurrentHeaterCoolerStateEnum> getCurrentHeaterCoolerState()
Retrieves the heater /cooler current state.- Returns:
- a future that will contain the heater cooler current state .
-
getTargetHeaterCoolerState
java.util.concurrent.CompletableFuture<TargetHeaterCoolerStateEnum> getTargetHeaterCoolerState()
Retrieves the heater cooler target state.- Returns:
- a future that will contain the heater cooler target state .
-
setTargetHeaterCoolerState
java.util.concurrent.CompletableFuture<java.lang.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 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.
-
-