Class LightImpl

java.lang.Object
io.github.zeroone3010.yahueapi.v2.LightImpl
All Implemented Interfaces:
Device, Light

public class LightImpl
extends Object
implements Light
  • Constructor Details

  • Method Details

    • getId

      public UUID getId()
      Description copied from interface: Light

      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.

      Specified by:
      getId in interface Device
      Specified by:
      getId in interface Light
      Returns:
      Id of the light.
    • getName

      public String getName()
      Description copied from interface: Light
      Returns the name of the light, as set by the user.
      Specified by:
      getName in interface Device
      Specified by:
      getName in interface Light
      Returns:
      Name of the light.
    • turnOn

      public void turnOn()
      Description copied from interface: Light
      Turns the light on.
      Specified by:
      turnOn in interface Light
    • turnOff

      public void turnOff()
      Description copied from interface: Light
      Turns the light off.
      Specified by:
      turnOff in interface Light
    • isOn

      public boolean isOn()
      Description copied from interface: Light
      Queries the light state.
      Specified by:
      isOn in interface Light
      Returns:
      True if the light is on, false if it is off.
    • setBrightness

      public void setBrightness​(int brightness)
      Description copied from interface: Light
      Sets the brightness of the light. If the light is off, does not turn it on, nor does 0 turn it off.
      Specified by:
      setBrightness in interface Light
      Parameters:
      brightness - A value from 1 (minimum brightness) to 100 (maximum brightness).
    • setState

      public void setState​(UpdateState state)
      Description copied from interface: Light
      Sets a state for the light.
      Specified by:
      setState in interface Light
      Parameters:
      state - A state to be set for this light.
    • getSupportedEffects

      public Collection<EffectType> getSupportedEffects()
      Description copied from interface: Light
      The effects that this light supports. May be empty but never null.
      Specified by:
      getSupportedEffects in interface Light
      Returns:
      A collection of supported effect types.
    • toString

      public String toString()
      Overrides:
      toString in class Object