Package io.github.hapjava.accessories
Interface WindowCoveringAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface WindowCoveringAccessory extends HomekitAccessory
A window covering, like blinds, which can be remotely controlled.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Integer>
getCurrentPosition()
Retrieves the current positionjava.util.concurrent.CompletableFuture<PositionStateEnum>
getPositionState()
Retrieves the state of the position: increasing, decreasing, or stoppeddefault java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<java.lang.Integer>
getTargetPosition()
Retrieves the target positionjava.util.concurrent.CompletableFuture<java.lang.Void>
setTargetPosition(int position)
Sets the target positionvoid
subscribeCurrentPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current position.void
subscribePositionState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the position state: increasing, decreasing, or stoppedvoid
subscribeTargetPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target position.void
unsubscribeCurrentPosition()
Unsubscribes from changes in the current position.void
unsubscribePositionState()
Unsubscribes from changes in the position statevoid
unsubscribeTargetPosition()
Unsubscribes from changes in the target position.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentPosition
java.util.concurrent.CompletableFuture<java.lang.Integer> getCurrentPosition()
Retrieves the current position- Returns:
- a future that will contain the position as a value between 0 and 100
-
getTargetPosition
java.util.concurrent.CompletableFuture<java.lang.Integer> getTargetPosition()
Retrieves the target position- Returns:
- a future that will contain the target position as a value between 0 and 100
-
getPositionState
java.util.concurrent.CompletableFuture<PositionStateEnum> getPositionState()
Retrieves the state of the position: increasing, decreasing, or stopped- Returns:
- a future that will contain the current state
-
setTargetPosition
java.util.concurrent.CompletableFuture<java.lang.Void> setTargetPosition(int position) throws java.lang.Exception
Sets the target position- Parameters:
position
- the target position to set, as a value between 1 and 100- Returns:
- a future that completes when the change is made
- Throws:
java.lang.Exception
- when the change cannot be made
-
subscribeCurrentPosition
void subscribeCurrentPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current position.- Parameters:
callback
- the function to call when the state changes.
-
subscribeTargetPosition
void subscribeTargetPosition(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target position.- Parameters:
callback
- the function to call when the state changes.
-
subscribePositionState
void subscribePositionState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the position state: increasing, decreasing, or stopped- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentPosition
void unsubscribeCurrentPosition()
Unsubscribes from changes in the current position.
-
unsubscribeTargetPosition
void unsubscribeTargetPosition()
Unsubscribes from changes in the target position.
-
unsubscribePositionState
void unsubscribePositionState()
Unsubscribes from changes in the position state
-
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.
-
-