Package io.github.hapjava.accessories
Interface GarageDoorOpenerAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface GarageDoorOpenerAccessory extends HomekitAccessory
garage door opener accessory with control and status of a garage door- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentDoorStateEnum>
getCurrentDoorState()
Retrieves the current state of the doorjava.util.concurrent.CompletableFuture<java.lang.Boolean>
getObstructionDetected()
Retrieves an indicator of an obstruction detected by the doordefault java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetDoorStateEnum>
getTargetDoorState()
Retrieves the targeted state of the doorjava.util.concurrent.CompletableFuture<java.lang.Void>
setTargetDoorState(TargetDoorStateEnum state)
Sets the targeted state of the door.void
subscribeCurrentDoorState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's statevoid
subscribeObstructionDetected(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the obstruction detected indicatorvoid
subscribeTargetDoorState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's targeted statevoid
unsubscribeCurrentDoorState()
Unsubscribes from changes in the door's statevoid
unsubscribeObstructionDetected()
Unsubscribes from changes in the door's obstruction detected indicatorvoid
unsubscribeTargetDoorState()
Unsubscribes from changes in the door's targeted state-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentDoorState
java.util.concurrent.CompletableFuture<CurrentDoorStateEnum> getCurrentDoorState()
Retrieves the current state of the door- Returns:
- a future which will contain the door's state
-
getTargetDoorState
java.util.concurrent.CompletableFuture<TargetDoorStateEnum> getTargetDoorState()
Retrieves the targeted state of the door- Returns:
- a future which will contain the door's targeted state
-
getObstructionDetected
java.util.concurrent.CompletableFuture<java.lang.Boolean> getObstructionDetected()
Retrieves an indicator of an obstruction detected by the door- Returns:
- a future which will contain the indicator
-
setTargetDoorState
java.util.concurrent.CompletableFuture<java.lang.Void> setTargetDoorState(TargetDoorStateEnum state) throws java.lang.Exception
Sets the targeted state of the door.- Parameters:
state
- the targeted state- Returns:
- a future that completes when the change is made
- Throws:
java.lang.Exception
- when the change cannot be made
-
subscribeCurrentDoorState
void subscribeCurrentDoorState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's state- Parameters:
callback
- the function to call when the state changes
-
subscribeTargetDoorState
void subscribeTargetDoorState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's targeted state- Parameters:
callback
- the function to call when the targeted state changes
-
subscribeObstructionDetected
void subscribeObstructionDetected(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the obstruction detected indicator- Parameters:
callback
- the function to call when the indicator chnages
-
unsubscribeCurrentDoorState
void unsubscribeCurrentDoorState()
Unsubscribes from changes in the door's state
-
unsubscribeTargetDoorState
void unsubscribeTargetDoorState()
Unsubscribes from changes in the door's targeted state
-
unsubscribeObstructionDetected
void unsubscribeObstructionDetected()
Unsubscribes from changes in the door's obstruction detected indicator
-
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.
-
-