Package io.github.hapjava.accessories
Interface WindowAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface WindowAccessory extends HomekitAccessory
motorized window accessory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletableFuture<Integer>getCurrentPosition()Retrieves the current position of the doorCompletableFuture<PositionStateEnum>getPositionState()Retrieves the position state of the doordefault Collection<Service>getServices()The collection of Services this accessory supports.CompletableFuture<Integer>getTargetPosition()Retrieves the target position of the doorCompletableFuture<Void>setTargetPosition(Integer position)Sets the targeted state of the door.voidsubscribeCurrentPosition(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the door's current positionvoidsubscribePositionState(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the door's position statevoidsubscribeTargetPosition(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the door's target positionvoidunsubscribeCurrentPosition()Unsubscribes from changes in the door's current positionvoidunsubscribePositionState()Unsubscribes from changes in the door's statevoidunsubscribeTargetPosition()Unsubscribes from changes in the door's target position-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getPositionState
CompletableFuture<PositionStateEnum> getPositionState()
Retrieves the position state of the door- Returns:
- a future which will contain the door's position state
-
getCurrentPosition
CompletableFuture<Integer> getCurrentPosition()
Retrieves the current position of the door- Returns:
- a future which will contain the door's current position
-
getTargetPosition
CompletableFuture<Integer> getTargetPosition()
Retrieves the target position of the door- Returns:
- a future which will contain the door's target position
-
setTargetPosition
CompletableFuture<Void> setTargetPosition(Integer position) throws Exception
Sets the targeted state of the door.- Parameters:
position- the targeted position- Returns:
- a future that completes when the change is made
- Throws:
Exception- when the change cannot be made
-
subscribePositionState
void subscribePositionState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's position state- Parameters:
callback- the function to call when the state changes
-
subscribeCurrentPosition
void subscribeCurrentPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's current position- Parameters:
callback- the function to call when the current position changes
-
subscribeTargetPosition
void subscribeTargetPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the door's target position- Parameters:
callback- the function to call when the target position changes
-
unsubscribePositionState
void unsubscribePositionState()
Unsubscribes from changes in the door's state
-
unsubscribeCurrentPosition
void unsubscribeCurrentPosition()
Unsubscribes from changes in the door's current position
-
unsubscribeTargetPosition
void unsubscribeTargetPosition()
Unsubscribes from changes in the door's target position
-
getServices
default Collection<Service> getServices()
Description copied from interface:HomekitAccessoryThe 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:
getServicesin interfaceHomekitAccessory- Returns:
- the collection of services.
-
-