This controls how quickly the morph runs. It is measured in seconds. A lower number means the animation is faster.
:duration
numeric
infinite
How long the animation lasts for in seconds. Not specifying a duration makes the animation never stop. Specifying 0 makes the animation stop. Note that there is a known bug where the tile remains in the animation once it has completed if duration is nonzero.
:palette
array of colors
7 colours across the spectrum
You can control the colors in the animation by specifying a list of color specifiers. For example ["red", "hue:100 saturation:1"].
:power_on
boolean
true
Switch any selected device that is off to on before performing the effect.
This controls how quickly the flame runs. It is measured in seconds. A lower number means the animation is faster.
:duration
numeric
infinite
How long the animation lasts for in seconds. Not specifying a duration makes the animation never stop. Specifying 0 makes the animation stop. Note that there is a known bug where the tile remains in the animation once it has completed if duration is nonzero.
:power_on
boolean
true
Switch any selected device that is off to on before performing the effect.
Array of state hashes as per #set_state. Must have 2 to 5 entries.
:defaults
hash
Default values to use when not specified in each states[] object.
:direction
direction
forward
Direction in which to cycle through the list. Can be forward or backward.
list_scenes
No parameters
activate_scene
Parameters
Key
Type
Mandatory
Default
Description
:scene_uuid
uuid
✔
The UUID for the scene you wish to activate
:duration
numeric
1.0
The time in seconds to spend performing the scene transition.
:ignore
array of strings
Any of power, infrared, duration, intensity, hue, saturation, brightness or kelvin, specifying that these properties should not be changed on devices when applying the scene.
:overrides
hash
A state hash as per #set_state specifying properties to apply to all devices in the scene, overriding those configured in the scene.
validate_color
Parameters
Key
Type
Mandatory
Default
Description
:color
color
✔
Color string you'd like to validate
Deviation from the API spec
Some API endpoints require a mandatory selector parameter, which defines which bulbs to apply your action to. This client will default the selector parameter to 'all', if no selector is provided.
# which means that you can call
client.list_bulbs
# ...and receive a hash of all your bulbs back# instead of having to explicitly specify you want all bulbs:
client.list_bulbs selector:'all'
Exceptions
If there is an error, LifxApi will raise an exception. The exception message will usually give a good indication of what went wrong, but you can also rescue the exception and access the request, response and decoded JSON objects, via the request, response and data methods.
Development
Run rake test to run the tests and rake console to start an interactive pry console.
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.