Interface Light


public interface Light
  • Method Summary

    Modifier and Type Method Description
    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

    • 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.