This function discovers and controls LiFX WiFi bulbs.
When the function receives a message on the cdd/lifx/command
topic that looks like this:
{
"action": "scan"
}
It will respond with a list of the LiFX WiFi bulbs it has discovered on the cdd/lifx/status
topic like this:
[
"Office light",
"Two bulb light #1",
"Two bulb light #2",
"Tall light",
"Light on table"
]
When the function receives a message on the cdd/lifx/command
topic that looks like this:
{
"action": "off",
"bulb": "Tall light"
}
Only one bulb can be specified per message.
It will attempt to turn off the LiFX WiFi bulb named "Tall light". No status is reported back from this command.
When the function receives a message on the cdd/lifx/command
topic that looks like this:
{
"action": "on",
"bulb": "Tall light",
"color": "0, 0, 100, 9000"
}
Only one bulb can be specified per message.
It will attempt to turn on the LiFX WiFi bulb named "Tall light". It will set the hue, saturation, brightness, and kelvin to 0, 0, 100, and 9000, respectively.
If you leave out the color value it will default to 0, 0, 100, 9000.