Interface AccessoryWithRemainingDuration
-
public interface AccessoryWithRemainingDurationAccessory with remaining duration characteristic.- Author:
- Tim Harper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetMaxRemainingDuration()return the max value for remaining duration.default intgetMinRemainingDuration()return the min value for remaining duration.java.util.concurrent.CompletableFuture<java.lang.Integer>getRemainingDuration()Retrieves the remaining durationvoidsubscribeRemainingDuration(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the duration; note it is not necessary to emit a change every second, homekit infers the countdown progress client side.voidunsubscribeRemainingDuration()Unsubscribes from changes
-
-
-
Method Detail
-
getRemainingDuration
java.util.concurrent.CompletableFuture<java.lang.Integer> getRemainingDuration()
Retrieves the remaining duration- Returns:
- a future with the duration in seconds
-
getMinRemainingDuration
default int getMinRemainingDuration()
return the min value for remaining duration. overwrite if you want to change the default value.- Returns:
- min remaining duration
-
getMaxRemainingDuration
default int getMaxRemainingDuration()
return the max value for remaining duration. overwrite if you want to change the default value.- Returns:
- max remaining duration
-
subscribeRemainingDuration
void subscribeRemainingDuration(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the duration; note it is not necessary to emit a change every second, homekit infers the countdown progress client side.- Parameters:
callback- the function when the existing duration has been replaced with a new one.
-
unsubscribeRemainingDuration
void unsubscribeRemainingDuration()
Unsubscribes from changes
-
-