Interface AccessoryWithColor
-
public interface AccessoryWithColorAccessory with Color- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Double>getHue()Retrieves the current hue of the light.CompletableFuture<Double>getSaturation()Retrieves the saturation of the light.CompletableFuture<Void>setHue(Double value)Sets the current hue of the lightCompletableFuture<Void>setSaturation(Double value)Sets the saturation of the light.voidsubscribeHue(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the hue of the light.voidsubscribeSaturation(HomekitCharacteristicChangeCallback callback)Subscribes to changes in the saturation of the light.voidunsubscribeHue()Unsubscribes from changes in the hue of the light.voidunsubscribeSaturation()Unsubscribes from changes in the saturation of the light.
-
-
-
Method Detail
-
getHue
CompletableFuture<Double> getHue()
Retrieves the current hue of the light.- Returns:
- a future that will contain the hue, expressed in arc degrees from 0 to 360.
-
setHue
CompletableFuture<Void> setHue(Double value) throws Exception
Sets the current hue of the light- Parameters:
value- the hue to set, expressed in arc degrees from 0 to 360.- Returns:
- a future that completes when the hue is changed
- Throws:
Exception- when the hue cannot be changed.
-
subscribeHue
void subscribeHue(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the hue of the light.- Parameters:
callback- the function to call when the state changes.
-
unsubscribeHue
void unsubscribeHue()
Unsubscribes from changes in the hue of the light.
-
getSaturation
CompletableFuture<Double> getSaturation()
Retrieves the saturation of the light.- Returns:
- a future that will contain the saturation, expressed as a value between 0 and 100.
-
setSaturation
CompletableFuture<Void> setSaturation(Double value) throws Exception
Sets the saturation of the light.- Parameters:
value- the saturation to set, expressed as a value between 0 and 100.- Returns:
- a future that completes when the saturation is changed.
- Throws:
Exception- when the saturation cannot be set.
-
subscribeSaturation
void subscribeSaturation(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the saturation of the light.- Parameters:
callback- the function to call when the state changes.
-
unsubscribeSaturation
void unsubscribeSaturation()
Unsubscribes from changes in the saturation of the light.
-
-