Package io.github.hapjava.accessories
Interface LeakSensorAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface LeakSensorAccessory extends HomekitAccessory
A leak sensor that reports whether a leak has been detected.- Author:
- Tim Harper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<LeakDetectedStateEnum>
getLeakDetected()
Retrieves the state of the leak sensor.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.void
subscribeLeakDetected(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the leak sensor.void
unsubscribeLeakDetected()
Unsubscribes from changes in the leak sensor.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getLeakDetected
java.util.concurrent.CompletableFuture<LeakDetectedStateEnum> getLeakDetected()
Retrieves the state of the leak sensor. If true then leak has been detected.- Returns:
- a future that will contain the leak sensor's state
-
subscribeLeakDetected
void subscribeLeakDetected(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the leak sensor.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeLeakDetected
void unsubscribeLeakDetected()
Unsubscribes from changes in the leak sensor.
-
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.
-
-