Class Light
java.lang.Object
org.openremote.agent.protocol.tradfri.device.Device
org.openremote.agent.protocol.tradfri.device.Light
The class that represents an IKEA TRÃ…DFRI light
-
Field Summary
Fields inherited from class org.openremote.agent.protocol.tradfri.device.Device
coapClient -
Constructor Summary
ConstructorsConstructorDescriptionLight(String name, Long creationDate, Integer instanceId, DeviceInfo deviceInfo, LightProperties properties, CoapClient coapClient) Construct the Light class -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply the updates in the update queue to the lightbooleanapplyUpdates(Integer transitionTime) Apply the updates in the update queue to the lightGet the brightness of the lightGet the colour of the light in hexadecimalsorg.openremote.model.value.impl.ColourRGBGet the RGB values of the colour of the lightGet the colour temperature of the lightGet the X value of the colour of the lightGet the XY values of the colour of the lightGet the Y value of the colour of the lightgetHue()Get the hue of the lightgetOn()Get the on / off state of the lightGet the properties of the lightGet the saturation of the lightbooleansetBrightness(Integer brightness) Set the brightness of the lightbooleansetBrightness(Integer brightness, Integer transitionTime) Set the brightness of the lightbooleanSet the colour of the lightbooleanSet the colour of the lightbooleansetColour(org.openremote.model.value.impl.ColourRGB colourRGB) Set the colour of the lightbooleanSet the colour of the lightbooleansetColourHex(String colourHex) Set the colour of the light to a predefined hexadecimal colourbooleansetColourHex(String colourHex, Integer transitionTime) Set the colour of the light to a predefined hexadecimal colourbooleansetColourRGB(int colourRed, int colourGreen, int colourBlue) Set the colour of the lightbooleansetColourRGB(int colourRed, int colourGreen, int colourBlue, Integer transitionTime) Set the colour of the lightbooleansetColourTemperature(Integer colourTemperature) Set the colour temperature of the lightbooleansetColourTemperature(Integer colourTemperature, Integer transitionTime) Set the colour temperature of the lightbooleansetColourXY(Integer colourX, Integer colourY) Set the colour of the lightbooleansetColourXY(Integer colourX, Integer colourY, Integer transitionTime) Set the colour of the lightbooleanSet the hue of the lightbooleanSet the hue of the lightbooleanSet the on / off state of the lightbooleanSet the on / off state of the lightvoidsetProperties(DeviceProperties properties) Set the properties of the lightbooleansetSaturation(Integer saturation) Set the saturation of the lightbooleansetSaturation(Integer saturation, Integer transitionTime) Set the saturation of the lightvoidupdateBrightness(Integer brightness) Update the brightness of the light in the update queuevoidupdateColour(ColourXY colourXY) Update the colour of the light in the update queuevoidupdateColour(org.openremote.model.value.impl.ColourRGB colourRGB) Update the colour of the light in the update queuevoidupdateColourHex(String colourHex) Update the colour of the light in the update queue to a predefined hexadecimal colourvoidupdateColourRGB(int colourRed, int colourGreen, int colourBlue) Update the colour of the light in the update queuevoidupdateColourTemperature(Integer colourTemperature) Update the colour temperature of the light in the update queuevoidupdateColourXY(Integer colourX, Integer colourY) Update the colour of the light in the update queuevoidUpdate the hue of the light in the update queuevoidUpdate the on / off state of the light in the update queuevoidupdateSaturation(Integer saturation) Update the saturation of the light in the update queuevoidupdateTransitionTime(Integer transitionTime) Update the transition time for updating the light in the update queueMethods inherited from class org.openremote.agent.protocol.tradfri.device.Device
addEventHandler, disableObserve, enableObserve, getCreationDate, getDeviceInfo, getEndpoint, getEventHandlers, getInstanceId, getName, isLight, isPlug, removeEventHandler, setCreationDate, setInstanceId, setName, toLight, toPlug
-
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 lightcreationDate- The creation date of the lightinstanceId- The instance id of the lightdeviceInfo- The information of the deviceproperties- The properties of the lightcoapClient- A CoAP client that can be used to communicate with the light using the IKEA TRÃ…DFRI gateway
-
-
Method Details
-
getProperties
Get the properties of the light- Overrides:
getPropertiesin classDevice- Returns:
- The properties of the light
-
setProperties
Set the properties of the light- Overrides:
setPropertiesin classDevice- Parameters:
properties- The properties of the light
-
getOn
Get the on / off state of the light- Returns:
- The on / off state of the light (true for on, false for off)
-
getBrightness
Get the brightness of the light- Returns:
- The brightness of the light
-
getColourHex
Get the colour of the light in hexadecimals- Returns:
- The colour of the light in hexadecimals
-
getHue
Get the hue of the light- Returns:
- The hue of the light
-
getSaturation
Get the saturation of the light- Returns:
- The saturation of the light
-
getColourX
Get the X value of the colour of the light- Returns:
- The X value of the colour of the light
-
getColourY
Get the Y value of the colour of the light- Returns:
- The Y value of the colour of the light
-
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
Get the colour temperature of the light- Returns:
- The colour temperature of the light
-
updateOn
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
Update the brightness of the light in the update queue- Parameters:
brightness- The new brightness for the light
-
updateColourHex
Update the colour of the light in the update queue to a predefined hexadecimal colour- Parameters:
colourHex- The new colour for the light
-
updateHue
Update the hue of the light in the update queue- Parameters:
hue- The new hue for the light
-
updateSaturation
Update the saturation of the light in the update queue- Parameters:
saturation- The new saturation for the light
-
updateColourXY
Update the colour of the light in the update queue- Parameters:
colourX- The X value of the new colour for the lightcolourY- The Y value of the new colour for the light
-
updateColour
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 lightcolourGreen- The green value of the new colour for the lightcolourBlue- The blue value of the new colour for the light
-
updateColourTemperature
Update the colour temperature of the light in the update queue- Parameters:
colourTemperature- The new colour temperature for the light
-
updateTransitionTime
Update the transition time for updating the light in the update queue- Parameters:
transitionTime- The new transition time for updating the light
-
setOn
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
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
Set the brightness of the light- Parameters:
brightness- The new brightness for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the brightness of the light, false if not
-
setBrightness
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
Set the colour of the light to a predefined hexadecimal colour- Parameters:
colourHex- The new colour for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the colour of the light, false if not
-
setColourHex
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
Set the hue of the light- Parameters:
hue- The new hue for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the hue of the light, false if not
-
setHue
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
Set the saturation of the light- Parameters:
saturation- The new saturation for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the saturation of the light, false if not
-
setSaturation
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
Set the colour of the light- Parameters:
colourX- The X value of the new colour for the lightcolourY- The Y value of the new colour for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the colour of the light, false if not
-
setColourXY
Set the colour of the light- Parameters:
colourX- The X value of the new colour for the lightcolourY- The Y value of the new colour for the light- Returns:
- True if successfully updated the colour of the light, false if not
-
setColour
Set the colour of the light- Parameters:
colourXY- The new colour for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the colour of the light, false if not
-
setColour
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 lighttransitionTime- 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
Set the colour of the light- Parameters:
colourRed- The red value of the new colour for the lightcolourGreen- The green value of the new colour for the lightcolourBlue- The blue value of the new colour for the lighttransitionTime- 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 lightcolourGreen- The green value of the new colour for the lightcolourBlue- The blue value of the new colour for the light- Returns:
- True if successfully updated the colour of the light, false if not
-
setColourTemperature
Set the colour temperature of the light- Parameters:
colourTemperature- The new colour temperature for the lighttransitionTime- The transition time for updating the light- Returns:
- True if successfully updated the colour temperature of the light, false if not
-
setColourTemperature
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
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
-