Interface AccessoryWithVolume
-
public interface AccessoryWithVolumeAccessory with volume values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Integer>getVolume()Retrieves the current volumeCompletableFuture<Void>setVolume(Integer value)Sets the current volumevoidsubscribeVolume(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the volume.voidunsubscribeVolume()Unsubscribes from changes in the volume.
-
-
-
Method Detail
-
getVolume
CompletableFuture<Integer> getVolume()
Retrieves the current volume- Returns:
- a future that will contain the volume, expressed as an integer between 0 and 100.
-
setVolume
CompletableFuture<Void> setVolume(Integer value) throws 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:
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.
-
-