lx_list_lights {lifx} | R Documentation |
list available lights
Description
list available lights
Usage
lx_list_lights(selector = "all", token = lx_get_token())
Arguments
selector |
'LIFX' api "selector" such as "all", "id:12345", or "location:kitchen". Can be created with |
token |
API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see |
Details
each item in the returned list contains (depending on the type of lamp), the following named items:
Reachability:
connected, last_seen, seconds_since_seen
Light identifiers / selectors:
id, uuid, label, group, location
Status:
power, color, brightness, effect
Hardware information:
product
Value
a list with each item representing one light. Each item itself is a list with all relevant information about the light and it's state
Examples
## Not run:
lx_list_lights()
lights <- lx_list_lights(
lx_selector(location = "kitchen")
)
first_kitchen_light <- lights[[1]]
first_kitchen_light$power
first_kitchen_light$color$hue
first_kitchen_light$color$saturation
first_kitchen_light$group
## End(Not run)