Interface Light


public interface Light
A single Philips Hue -compatible light. Could be a bulb, a ceiling fixture, a LED strip, or anything in between. Even remote controlled wall sockets are considered as "lights" by the Hue Bridge.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getId()
    Returns the technical id of the light, as assigned by the Bridge.
    java.lang.Integer getMaxLumens()
    Returns the maximum number of lumens that this light is capable of emitting, if the light reports such a number.
    java.lang.String getName()
    Returns the name of the light, as set by the user.
    State getState()
    Gets the state of the light -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
    LightType getType()
    Returns info on the type of the light.
    boolean isOn()
    Queries the light state -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
    boolean isReachable()
    Queries the reachability of the light -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
    void setBrightness​(int brightness)
    Sets the brightness of the light.
    void setState​(State state)
    Sets a state for the light.
    void turnOff()
    Turns the light off.
    void turnOn()
    Turns the light on.
  • Method Details

    • getId

      java.lang.String getId()

      Returns the technical id of the light, as assigned by the Bridge. The id stays the same even if the light name is changed by the user.

      Note that the id is only unique within the context of a single bridge.

      Returns:
      Id of the light.
      Since:
      2.4.0
    • getName

      java.lang.String getName()
      Returns the name of the light, as set by the user.
      Returns:
      Name of the light.
    • turnOn

      void turnOn()
      Turns the light on.
    • turnOff

      void turnOff()
      Turns the light off.
    • isOn

      boolean isOn()
      Queries the light state -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
      Returns:
      True if the light is on, false if it is off.
    • isReachable

      boolean isReachable()
      Queries the reachability of the light -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
      Returns:
      True if the light is reachable, false if it is not.
    • setBrightness

      void setBrightness​(int brightness)
      Sets the brightness of the light. If the light is off, does not turn it on, nor does 0 turn it off.
      Parameters:
      brightness - A value from 0 (minimum brightness) to 254 (maximum brightness).
    • getType

      LightType getType()
      Returns info on the type of the light.
      Returns:
      An enum value specifying the color and dimming capabilities of the light.
    • setState

      void setState​(State state)
      Sets a state for the light.
      Parameters:
      state - A state to be set for this light.
    • getState

      State getState()
      Gets the state of the light -- or returns the cached state if caching has been enabled with Hue.setCaching(boolean).
      Returns:
      The current state of the light.
    • getMaxLumens

      java.lang.Integer getMaxLumens()
      Returns the maximum number of lumens that this light is capable of emitting, if the light reports such a number. This method will return null for, for example, smart plugs.
      Returns:
      Maximum lumens that this light is capable of emitting, or null if unknown or undefined.
      Since:
      2.4.0