Package io.github.hapjava.accessories
Interface LockMechanismAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface LockMechanismAccessory extends HomekitAccessory
Lock mechanism with current and target state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<LockCurrentStateEnum>
getLockCurrentState()
Retrieves the lock current state.java.util.concurrent.CompletableFuture<LockTargetStateEnum>
getLockTargetState()
Retrieves the lock target state.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<java.lang.Void>
setLockTargetState(LockTargetStateEnum state)
set lock target state the lock target state.void
subscribeLockCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the lock current state.void
subscribeLockTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the lock target state.void
unsubscribeLockCurrentState()
Unsubscribes from changes in lock current state.void
unsubscribeLockTargetState()
Unsubscribes from changes in lock target state.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getLockCurrentState
java.util.concurrent.CompletableFuture<LockCurrentStateEnum> getLockCurrentState()
Retrieves the lock current state.- Returns:
- a future that will contain the lock current state .
-
getLockTargetState
java.util.concurrent.CompletableFuture<LockTargetStateEnum> getLockTargetState()
Retrieves the lock target state.- Returns:
- a future that will contain the lock target state .
-
setLockTargetState
java.util.concurrent.CompletableFuture<java.lang.Void> setLockTargetState(LockTargetStateEnum state)
set lock target state the lock target state.- Parameters:
state
- lock target state- Returns:
- a future that completes when the change is made
-
subscribeLockCurrentState
void subscribeLockCurrentState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the lock current state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeLockCurrentState
void unsubscribeLockCurrentState()
Unsubscribes from changes in lock current state.
-
subscribeLockTargetState
void subscribeLockTargetState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the lock target state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeLockTargetState
void unsubscribeLockTargetState()
Unsubscribes from changes in lock target 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.
-
-