Interface AccessoryWithDuration
-
public interface AccessoryWithDuration
Accessory with duration characteristic.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
getMaxDuration()
return the max value for duration.default int
getMinDuration()
return the min value for duration.java.util.concurrent.CompletableFuture<java.lang.Integer>
getSetDuration()
Retrieves the current set duration;java.util.concurrent.CompletableFuture<java.lang.Void>
setSetDuration(int value)
Sets the duration for which the service should run.void
subscribeSetDuration(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the set durationvoid
unsubscribeSetDuration()
Unsubscribes from changes
-
-
-
Method Detail
-
getSetDuration
java.util.concurrent.CompletableFuture<java.lang.Integer> getSetDuration()
Retrieves the current set duration;- Returns:
- a future with the value
-
getMinDuration
default int getMinDuration()
return the min value for duration. overwrite if you want to change the default value.- Returns:
- min remaining duration
-
getMaxDuration
default int getMaxDuration()
return the max value for duration. overwrite if you want to change the default value.- Returns:
- max duration
-
setSetDuration
java.util.concurrent.CompletableFuture<java.lang.Void> setSetDuration(int value)
Sets the duration for which the service should run.- Parameters:
value
- duration in seconds- Returns:
- a future that completes when the change is made
-
subscribeSetDuration
void subscribeSetDuration(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the set duration- Parameters:
callback
- the function when the duration has changed
-
unsubscribeSetDuration
void unsubscribeSetDuration()
Unsubscribes from changes
-
-