java.lang.Object
org.openremote.agent.protocol.tradfri.device.Device
org.openremote.agent.protocol.tradfri.device.Light

public class Light extends Device
The class that represents an IKEA TRÃ…DFRI light
  • Constructor Details

    • Light

      public Light(String name, Long creationDate, Integer instanceId, DeviceInfo deviceInfo, LightProperties properties, CoapClient coapClient)
      Construct the Light class
      Parameters:
      name - The name of the light
      creationDate - The creation date of the light
      instanceId - The instance id of the light
      deviceInfo - The information of the device
      properties - The properties of the light
      coapClient - A CoAP client that can be used to communicate with the light using the IKEA TRÃ…DFRI gateway
  • Method Details

    • getProperties

      public LightProperties getProperties()
      Get the properties of the light
      Overrides:
      getProperties in class Device
      Returns:
      The properties of the light
    • setProperties

      public void setProperties(DeviceProperties properties)
      Set the properties of the light
      Overrides:
      setProperties in class Device
      Parameters:
      properties - The properties of the light
    • getOn

      public Boolean getOn()
      Get the on / off state of the light
      Returns:
      The on / off state of the light (true for on, false for off)
    • getBrightness

      public Integer getBrightness()
      Get the brightness of the light
      Returns:
      The brightness of the light
    • getColourHex

      public String getColourHex()
      Get the colour of the light in hexadecimals
      Returns:
      The colour of the light in hexadecimals
    • getHue

      public Integer getHue()
      Get the hue of the light
      Returns:
      The hue of the light
    • getSaturation

      public Integer getSaturation()
      Get the saturation of the light
      Returns:
      The saturation of the light
    • getColourX

      public Integer getColourX()
      Get the X value of the colour of the light
      Returns:
      The X value of the colour of the light
    • getColourY

      public Integer getColourY()
      Get the Y value of the colour of the light
      Returns:
      The Y value of the colour of the light
    • getColourXY

      public ColourXY getColourXY()
      Get the XY values of the colour of the light
      Returns:
      The XY values of the colour of the light
    • getColourRGB

      public org.openremote.model.value.impl.ColourRGB getColourRGB()
      Get the RGB values of the colour of the light
      Returns:
      The RGB values of the colour of the light
    • getColourTemperature

      public Integer getColourTemperature()
      Get the colour temperature of the light
      Returns:
      The colour temperature of the light
    • updateOn

      public void updateOn(Boolean on)
      Update the on / off state of the light in the update queue
      Parameters:
      on - The new on / off state for the light (true for on, false for off)
    • updateBrightness

      public void updateBrightness(Integer brightness)
      Update the brightness of the light in the update queue
      Parameters:
      brightness - The new brightness for the light
    • updateColourHex

      public void updateColourHex(String colourHex)
      Update the colour of the light in the update queue to a predefined hexadecimal colour
      Parameters:
      colourHex - The new colour for the light
    • updateHue

      public void updateHue(Integer hue)
      Update the hue of the light in the update queue
      Parameters:
      hue - The new hue for the light
    • updateSaturation

      public void updateSaturation(Integer saturation)
      Update the saturation of the light in the update queue
      Parameters:
      saturation - The new saturation for the light
    • updateColourXY

      public void updateColourXY(Integer colourX, Integer colourY)
      Update the colour of the light in the update queue
      Parameters:
      colourX - The X value of the new colour for the light
      colourY - The Y value of the new colour for the light
    • updateColour

      public void updateColour(ColourXY colourXY)
      Update the colour of the light in the update queue
      Parameters:
      colourXY - The new colour for the light
    • updateColour

      public void updateColour(org.openremote.model.value.impl.ColourRGB colourRGB)
      Update the colour of the light in the update queue
      Parameters:
      colourRGB - The new colour for the light
    • updateColourRGB

      public void updateColourRGB(int colourRed, int colourGreen, int colourBlue)
      Update the colour of the light in the update queue
      Parameters:
      colourRed - The red value of the new colour for the light
      colourGreen - The green value of the new colour for the light
      colourBlue - The blue value of the new colour for the light
    • updateColourTemperature

      public void updateColourTemperature(Integer colourTemperature)
      Update the colour temperature of the light in the update queue
      Parameters:
      colourTemperature - The new colour temperature for the light
    • updateTransitionTime

      public void updateTransitionTime(Integer transitionTime)
      Update the transition time for updating the light in the update queue
      Parameters:
      transitionTime - The new transition time for updating the light
    • setOn

      public boolean setOn(Boolean on, Integer transitionTime)
      Set the on / off state of the light
      Parameters:
      on - The new on / off state for the light (true for on, false for off)
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the on / off state of the light, false if not
    • setOn

      public boolean setOn(Boolean on)
      Set the on / off state of the light
      Parameters:
      on - The new on / off state for the light (true for on, false for off)
      Returns:
      True if successfully updated the on / off state of the light, false if not
    • setBrightness

      public boolean setBrightness(Integer brightness, Integer transitionTime)
      Set the brightness of the light
      Parameters:
      brightness - The new brightness for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the brightness of the light, false if not
    • setBrightness

      public boolean setBrightness(Integer brightness)
      Set the brightness of the light
      Parameters:
      brightness - The new brightness for the light
      Returns:
      True if successfully updated the brightness of the light, false if not
    • setColourHex

      public boolean setColourHex(String colourHex, Integer transitionTime)
      Set the colour of the light to a predefined hexadecimal colour
      Parameters:
      colourHex - The new colour for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColourHex

      public boolean setColourHex(String colourHex)
      Set the colour of the light to a predefined hexadecimal colour
      Parameters:
      colourHex - The new colour for the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setHue

      public boolean setHue(Integer hue, Integer transitionTime)
      Set the hue of the light
      Parameters:
      hue - The new hue for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the hue of the light, false if not
    • setHue

      public boolean setHue(Integer hue)
      Set the hue of the light
      Parameters:
      hue - The new hue for the light
      Returns:
      True if successfully updated the hue of the light, false if not
    • setSaturation

      public boolean setSaturation(Integer saturation, Integer transitionTime)
      Set the saturation of the light
      Parameters:
      saturation - The new saturation for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the saturation of the light, false if not
    • setSaturation

      public boolean setSaturation(Integer saturation)
      Set the saturation of the light
      Parameters:
      saturation - The new saturation for the light
      Returns:
      True if successfully updated the saturation of the light, false if not
    • setColourXY

      public boolean setColourXY(Integer colourX, Integer colourY, Integer transitionTime)
      Set the colour of the light
      Parameters:
      colourX - The X value of the new colour for the light
      colourY - The Y value of the new colour for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColourXY

      public boolean setColourXY(Integer colourX, Integer colourY)
      Set the colour of the light
      Parameters:
      colourX - The X value of the new colour for the light
      colourY - The Y value of the new colour for the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColour

      public boolean setColour(ColourXY colourXY, Integer transitionTime)
      Set the colour of the light
      Parameters:
      colourXY - The new colour for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColour

      public boolean setColour(ColourXY colourXY)
      Set the colour of the light
      Parameters:
      colourXY - The new colour for the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColour

      public boolean setColour(org.openremote.model.value.impl.ColourRGB colourRGB, Integer transitionTime)
      Set the colour of the light
      Parameters:
      colourRGB - The new colour for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColour

      public boolean setColour(org.openremote.model.value.impl.ColourRGB colourRGB)
      Set the colour of the light
      Parameters:
      colourRGB - The new colour for the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColourRGB

      public boolean setColourRGB(int colourRed, int colourGreen, int colourBlue, Integer transitionTime)
      Set the colour of the light
      Parameters:
      colourRed - The red value of the new colour for the light
      colourGreen - The green value of the new colour for the light
      colourBlue - The blue value of the new colour for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColourRGB

      public boolean setColourRGB(int colourRed, int colourGreen, int colourBlue)
      Set the colour of the light
      Parameters:
      colourRed - The red value of the new colour for the light
      colourGreen - The green value of the new colour for the light
      colourBlue - The blue value of the new colour for the light
      Returns:
      True if successfully updated the colour of the light, false if not
    • setColourTemperature

      public boolean setColourTemperature(Integer colourTemperature, Integer transitionTime)
      Set the colour temperature of the light
      Parameters:
      colourTemperature - The new colour temperature for the light
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the colour temperature of the light, false if not
    • setColourTemperature

      public boolean setColourTemperature(Integer colourTemperature)
      Set the colour temperature of the light
      Parameters:
      colourTemperature - The new colour temperature for the light
      Returns:
      True if successfully updated the colour temperature of the light, false if not
    • applyUpdates

      public boolean applyUpdates()
      Apply the updates in the update queue to the light
      Returns:
      True if successfully updated the light, false if not
    • applyUpdates

      public boolean applyUpdates(Integer transitionTime)
      Apply the updates in the update queue to the light
      Parameters:
      transitionTime - The transition time for updating the light
      Returns:
      True if successfully updated the light, false if not