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