Install the package:
devtools::install_github("cboettig/lifxr")
Get your Personal Authentication Token from the LIFX cloud: https://cloud.lifx.com/settings. Add this token into R using options()
in your .Rprofile
or current session:
options(LIFX_PAT = "<TOKEN>")
You can now load the library and control your lights:
library("lifxr")
lights()
on()
off()
All endpoints in v1beta1
of api.lifx.com are implemented, along with a few helper functions.
on()
Turn a light or group of lights onoff()
Turn a light group offbreathe()
run the breathe effect on a light group (with desired settings)color()
change the color of a light or grouplabel()
add a label to a lightlights()
List all lights and their statuspulse()
run the pulse effectscene()
switch to a certain preset scenetoggle()
toggle lights on or off
current_color()
return the current color of a light group (in a format appropriate for use withcolor
/breathe
/pulse
)ping()
the API to confirm it responds.
See package documentation for details.