lx_state: set light state (lifx API endpoint PUT set state)

Description Usage Arguments Value References

View source: R/state.R

Description

set light state (lifx API endpoint PUT set state)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 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)

Value

an 'httr' response object (see response)

References

https://api.developer.lifx.com/docs/set-state


lifx documentation built on July 1, 2020, 6:08 p.m.