Interface AccessoryWithVolume
-
public interface AccessoryWithVolume
Accessory with volume values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Integer>
getVolume()
Retrieves the current volumejava.util.concurrent.CompletableFuture<java.lang.Void>
setVolume(java.lang.Integer value)
Sets the current volumevoid
subscribeVolume(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the volume.void
unsubscribeVolume()
Unsubscribes from changes in the volume.
-
-
-
Method Detail
-
getVolume
java.util.concurrent.CompletableFuture<java.lang.Integer> getVolume()
Retrieves the current volume- Returns:
- a future that will contain the volume, expressed as an integer between 0 and 100.
-
setVolume
java.util.concurrent.CompletableFuture<java.lang.Void> setVolume(java.lang.Integer value) throws java.lang.Exception
Sets the current volume- Parameters:
value
- the volume, on a scale of 0 to 100, to set- Returns:
- a future that completes when the volume is changed
- Throws:
java.lang.Exception
- when the volume cannot be set
-
subscribeVolume
void subscribeVolume(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the volume.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeVolume
void unsubscribeVolume()
Unsubscribes from changes in the volume.
-
-