Package io.github.hapjava.accessories
Interface AirPurifierAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface AirPurifierAccessory extends HomekitAccessory
An air purifier.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentAirPurifierStateEnum>
getCurrentState()
Retrieves the current state of the air purifierdefault java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetAirPurifierStateEnum>
getTargetState()
Retrieves the air purifier target state.java.util.concurrent.CompletableFuture<java.lang.Boolean>
isActive()
Mandatory: Retrieves the current active state of the fan'.java.util.concurrent.CompletableFuture<java.lang.Void>
setActive(boolean state)
Sets the active state of the fanjava.util.concurrent.CompletableFuture<java.lang.Void>
setTargetState(TargetAirPurifierStateEnum state)
set target state the air purifier target state.void
subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the fan.void
subscribeCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the state of the air purifier.void
subscribeTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target state of the air purifier.void
unsubscribeActive()
Unsubscribes from changes in the active state of the fan.void
unsubscribeCurrentState()
Unsubscribes from changes in the state of the air purifier.void
unsubscribeTargetState()
Unsubscribes from changes in the target state of the air purifier.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
isActive
java.util.concurrent.CompletableFuture<java.lang.Boolean> isActive()
Mandatory: Retrieves the current active state of the fan'.- 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 fan- 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
-
subscribeActive
void subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the fan.- Parameters:
callback
- the function to call when the direction changes.
-
unsubscribeActive
void unsubscribeActive()
Unsubscribes from changes in the active state of the fan.
-
getCurrentState
java.util.concurrent.CompletableFuture<CurrentAirPurifierStateEnum> getCurrentState()
Retrieves the current state of the air purifier- Returns:
- a future that will contain the state
-
subscribeCurrentState
void subscribeCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the state of the air purifier.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentState
void unsubscribeCurrentState()
Unsubscribes from changes in the state of the air purifier.
-
getTargetState
java.util.concurrent.CompletableFuture<TargetAirPurifierStateEnum> getTargetState()
Retrieves the air purifier target state.- Returns:
- a future that will contain the air purifier target state .
-
setTargetState
java.util.concurrent.CompletableFuture<java.lang.Void> setTargetState(TargetAirPurifierStateEnum state)
set target state the air purifier target state.- Parameters:
state
- air purifier target state- Returns:
- a future that completes when the change is made
-
subscribeTargetState
void subscribeTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target state of the air purifier.- Parameters:
callback
- the function to call when the target state changes.
-
unsubscribeTargetState
void unsubscribeTargetState()
Unsubscribes from changes in the target state of the air purifier.
-
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.
-
-