API

adafruit_lifx

A CircuitPython/Python library for communicating with the LIFX HTTP Remote API.

  • Author(s): Brent Rubell for Adafruit Industries

Implementation Notes

Software and Dependencies:

or:

class adafruit_lifx.LIFX(wifi_manager, lifx_token)

HTTP Interface for interacting with the LIFX API

effects_off(selector, power_off=False)

Turns off any running effects on the selected device. :param dict selector: Selector to control which lights are requested. :param bool power_off: If true, the devices will also be turned off.

list_lights()

Enumerates all the lights associated with the LIFX Cloud Account

move_effect(selector, move_direction, period, power_on)

Performs a linear move effect on a light, or lights. :param str move_direction: Move direction, forward or backward. :param double period: Time in second per effect cycle. :param bool power_on: Turn on a light before performing the move.

set_brightness(selector, brightness)

Sets the state of the lights within the selector. :param dict selector: Selector to control which lights are requested. :param double brightness: Brightness level of the light, from 0.0 to 1.0.

set_color(selector, **kwargs)

Sets the state of the light’s color within the selector. Valid arguments: https://api.developer.lifx.com/docs/set-state

toggle_light(selector, all_lights=False, duration=0)

Toggles current state of LIFX light(s). :param dict selector: Selector to control which lights are requested. :param bool all: Toggle all lights at once. Defaults to false. :param double duration: Time (in seconds) to spend performing a toggle. Defaults to 0.