Interface AccessoryWithBrightness


  • public interface AccessoryWithBrightness
    Accessory with brightness values.
    Author:
    Andy Lintner
    • 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.Exception
        Sets 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.