Package io.github.hapjava.accessories
Interface HumiditySensorAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface HumiditySensorAccessory extends HomekitAccessory
A humidity sensor that reports the current relative humidity.- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Double>
getCurrentRelativeHumidity()
Retrieves the current relative humidity.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.void
subscribeCurrentRelativeHumidity(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current relative humidity.void
unsubscribeCurrentRelativeHumidity()
Unsubscribes from changes in the current relative humidity.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentRelativeHumidity
java.util.concurrent.CompletableFuture<java.lang.Double> getCurrentRelativeHumidity()
Retrieves the current relative humidity.- Returns:
- a future that will contain the humidity as a value between 0 and 100
-
subscribeCurrentRelativeHumidity
void subscribeCurrentRelativeHumidity(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current relative humidity.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentRelativeHumidity
void unsubscribeCurrentRelativeHumidity()
Unsubscribes from changes in the current relative 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.
-
-