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 lx_selector or written manually (see https://api.developer.lifx.com/docs/selectors

token

API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see lx_save_token)

Details

each item in the returned list contains (depending on the type of lamp), the following named items:

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)

[Package lifx version 0.2.0 Index]