Package io.github.hapjava.accessories
Interface HumidifierDehumidifierAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface HumidifierDehumidifierAccessory extends HomekitAccessory
Humidifier/Dehumidifier accessory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentHumidifierDehumidifierStateEnum>
getCurrentHumidifierDehumidifierState()
Retrieves the humidifier/dehumidifier current state.java.util.concurrent.CompletableFuture<java.lang.Double>
getCurrentHumidity()
Retrieves the current relative humidity.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetHumidifierDehumidifierStateEnum>
getTargetHumidifierDehumidifierState()
Retrieves the humidifier/dehumidifier target state.default TargetHumidifierDehumidifierStateEnum[]
getTargetHumidifierDehumidifierStateValidValues()
Valid values for target state.java.util.concurrent.CompletableFuture<java.lang.Boolean>
isActive()
Mandatory: Retrieves the current active state of the humidifier/dehumidifier.java.util.concurrent.CompletableFuture<java.lang.Void>
setActive(boolean state)
Sets the active state of the humidifier/dehumidifierjava.util.concurrent.CompletableFuture<java.lang.Void>
setTargetHumidifierDehumidifierState(TargetHumidifierDehumidifierStateEnum state)
set humidifier/dehumidifier target state the lock target state.void
subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the humidifier/dehumidifier .void
subscribeCurrentHumidifierDehumidifierState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the humidifier/dehumidifier current state.void
subscribeCurrentHumidity(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current humidity.void
subscribeTargetHumidifierDehumidifierState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the humidifier/dehumidifier target state.void
unsubscribeActive()
Unsubscribes from changes in the active state of the humidifier/dehumidifier .void
unsubscribeCurrentHumidifierDehumidifierState()
Unsubscribes from changes in humidifier/dehumidifier current state.void
unsubscribeCurrentHumidity()
Unsubscribes from changes in the current humidity.void
unsubscribeTargetHumidifierDehumidifierState()
Unsubscribes from changes in humidifier/dehumidifier target state.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentHumidity
java.util.concurrent.CompletableFuture<java.lang.Double> getCurrentHumidity()
Retrieves the current relative humidity.- Returns:
- a future that will contain the humidity as a value between 0 and 100.
-
isActive
java.util.concurrent.CompletableFuture<java.lang.Boolean> isActive()
Mandatory: Retrieves the current active state of the humidifier/dehumidifier.- 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 humidifier/dehumidifier- 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
-
getCurrentHumidifierDehumidifierState
java.util.concurrent.CompletableFuture<CurrentHumidifierDehumidifierStateEnum> getCurrentHumidifierDehumidifierState()
Retrieves the humidifier/dehumidifier current state.- Returns:
- a future that will contain the humidifier/dehumidifier current state .
-
getTargetHumidifierDehumidifierState
java.util.concurrent.CompletableFuture<TargetHumidifierDehumidifierStateEnum> getTargetHumidifierDehumidifierState()
Retrieves the humidifier/dehumidifier target state.- Returns:
- a future that will contain the humidifier/dehumidifier target state .
-
setTargetHumidifierDehumidifierState
java.util.concurrent.CompletableFuture<java.lang.Void> setTargetHumidifierDehumidifierState(TargetHumidifierDehumidifierStateEnum state)
set humidifier/dehumidifier target state the lock target state.- Parameters:
state
- humidifier/dehumidifier target state- Returns:
- a future that completes when the change is made
-
getTargetHumidifierDehumidifierStateValidValues
default TargetHumidifierDehumidifierStateEnum[] getTargetHumidifierDehumidifierStateValidValues()
Valid values for target state.- Returns:
- array of valid target states.
-
subscribeCurrentHumidifierDehumidifierState
void subscribeCurrentHumidifierDehumidifierState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the humidifier/dehumidifier current state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentHumidifierDehumidifierState
void unsubscribeCurrentHumidifierDehumidifierState()
Unsubscribes from changes in humidifier/dehumidifier current state.
-
subscribeTargetHumidifierDehumidifierState
void subscribeTargetHumidifierDehumidifierState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the humidifier/dehumidifier target state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeTargetHumidifierDehumidifierState
void unsubscribeTargetHumidifierDehumidifierState()
Unsubscribes from changes in humidifier/dehumidifier target state.
-
subscribeActive
void subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the humidifier/dehumidifier .- Parameters:
callback
- the function to call when the active state changes.
-
unsubscribeActive
void unsubscribeActive()
Unsubscribes from changes in the active state of the humidifier/dehumidifier .
-
subscribeCurrentHumidity
void subscribeCurrentHumidity(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current humidity.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentHumidity
void unsubscribeCurrentHumidity()
Unsubscribes from changes in the current humidity.
-
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.
-
-