lx_state {lifx} | R Documentation |
set light state (lifx API endpoint PUT set state)
Description
set light state (lifx API endpoint PUT set state)
Usage
lx_state(
power = NULL,
color_name = NULL,
brightness = NULL,
infrared = NULL,
duration = 0,
fast = FALSE,
selector = "all",
token = lx_get_token()
)
Arguments
power |
string - if set to "on", turns the light on, if set to "off" turns it off. |
color_name |
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. |
brightness |
set the brightness (0-1) |
infrared |
infrared brightness (0-1) |
duration |
in seconds, how long to perform the transition |
fast |
Executes the query fast, without initial state checks and wait for no results. See https://api.developer.lifx.com/docs/set-state |
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 |
Value
an 'httr' response object (see response
)
References
https://api.developer.lifx.com/docs/set-state