Package io.github.hapjava.accessories
Interface BasicFanAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface BasicFanAccessory extends HomekitAccessory
A fan with mandatory characteristics.- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<java.lang.Boolean>
isOn()
Mandatory: Retrieves the current power state of the fan.java.util.concurrent.CompletableFuture<java.lang.Void>
setOn(boolean state)
Sets the active state of the fanvoid
subscribeOn(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the fan.void
unsubscribeOn()
Unsubscribes from changes in the active state of the fan.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
isOn
java.util.concurrent.CompletableFuture<java.lang.Boolean> isOn()
Mandatory: Retrieves the current power state of the fan.- Returns:
- a future that will contain the binary state
-
setOn
java.util.concurrent.CompletableFuture<java.lang.Void> setOn(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
-
subscribeOn
void subscribeOn(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the fan.- Parameters:
callback
- the function to call when the active state changes.
-
unsubscribeOn
void unsubscribeOn()
Unsubscribes from changes in the active state of the fan.
-
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.
-
-