Interface AccessoryWithBrightness
-
public interface AccessoryWithBrightnessAccessory with brightness values.- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Integer>getBrightness()Retrieves the current brightness of the lightjava.util.concurrent.CompletableFuture<java.lang.Void>setBrightness(java.lang.Integer value)Sets the current brightness of the lightvoidsubscribeBrightness(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the brightness of the light.voidunsubscribeBrightness()Unsubscribes from changes in the brightness of the light.
-
-
-
Method Detail
-
getBrightness
java.util.concurrent.CompletableFuture<java.lang.Integer> getBrightness()
Retrieves the current brightness of the light- Returns:
- a future that will contain the brightness, expressed as an integer between 0 and 100.
-
setBrightness
java.util.concurrent.CompletableFuture<java.lang.Void> setBrightness(java.lang.Integer value) throws java.lang.ExceptionSets the current brightness of the light- Parameters:
value- the brightness, on a scale of 0 to 100, to set- Returns:
- a future that completes when the brightness is changed
- Throws:
java.lang.Exception- when the brightness cannot be set
-
subscribeBrightness
void subscribeBrightness(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the brightness of the light.- Parameters:
callback- the function to call when the state changes.
-
unsubscribeBrightness
void unsubscribeBrightness()
Unsubscribes from changes in the brightness of the light.
-
-