set light state (lifx API endpoint PUT set state)
lx_state(
power = NULL,
color_name = NULL,
brightness = NULL,
infrared = NULL,
duration = 0,
fast = FALSE,
selector = "all",
token = lx_get_token()
)
string - if set to "on", turns the light on, if set to "off" turns it off.
a color name (i.e. "red"), hexadecimal color code (i.e. "#FF0000") or output from lx_color() (in 'LIFX' api format (see https://api.developer.lifx.com/docs/colors). If this parameter is used, other parameters may be ignored.
set the brightness (0-1)
infrared brightness (0-1)
in seconds, how long to perform the transition
Executes the query fast, without initial state checks and wait for no results. See https://api.developer.lifx.com/docs/set-state
'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
API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see lx_save_token
)
an 'httr' response object (see response
)