lx_color: change the state of 'LIFX' lamps

Description Usage Arguments Value Examples

View source: R/color.R

Description

change the state of 'LIFX' lamps

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
lx_color(
  hue = NULL,
  saturation = NULL,
  brightness = NULL,
  kelvin = NULL,
  duration = NULL,
  infrared = NULL,
  color_name = NULL,
  fast = FALSE,
  delta = FALSE,
  selector = "all",
  power = NULL,
  token = lx_get_token()
)

Arguments

hue

set the hue (0-255)

saturation

set the saturation (0-1)

brightness

set the brightness (0-1)

kelvin

set the color temperature. limits depend on the specific lamp; limits are likely in the range of 2500-9000

duration

in seconds, how long to perform the transition

infrared

infrared brightness (0-1)

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.

fast

Executes the query fast, without initial state checks and wait for no results. See https://api.developer.lifx.com/docs/set-state

delta

if set to TRUE, color values (hue, saturation, brightness, kelvin, infrared) are added to the lights' current values. Can not be used in combination with 'color_name'

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

power

string - if set to "on", turns the light on, if set to "off" turns it off.

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)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
lx_color(hue = 200)
lx_color(saturation = 0.8)
lx_color(hue = 200, saturation = 0.5, brightness = 0.5)
lx_color(color_name = 'cyan', brightness = 1)
lx_color(kelvin = 5000, fast = TRUE)
lx_color(brightness = -0.3, delta = TRUE)

## End(Not run)

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