Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

Control LIFX devices over the internet using CircuitPython.

Dependencies

This driver depends on:

You’ll also need a library to communicate with an ESP32 as a coprocessor using a WiFiManager object. This library supports connecting an ESP32 using either SPI or UART.

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-lifx

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-lifx

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-lifx

Usage Example

Initialize the LIFX API Client with a WiFiManager object and a LIFX Personal Access token:

lifx = adafruit_lifx.LIFX(wifi, lifx_token)

Set a LIFX selector label to identify the LIFX device to communicate with.

lifx_light = 'label:Lamp'

List all connected LIFX devices:

lights = lifx.list_lights()

Toggle the state of a LIFX device:

lifx.toggle_light(lifx_light)

Set the brightness of a LIFX device to 50%:

lifx.set_brightness(lifx_light, 0.5)

Set the color of a LIFX device to blue and the brightness to 100%:

lifx.set_color(lifx_light, 'on', 'blue', brightness=1.0)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for adafruit-circuitpython-lifx 3.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adafruit-circuitpython-lifx 3.0.6
File Size Uploaded
adafruit_circuitpython_lifx-3.0.6.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-lifx 3.0.6
File Interpreter ABI Platform
adafruit_circuitpython_lifx-3.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / adafruit_circuitpython_lifx-3.0.6.tar.gz

Download URL adafruit_circuitpython_lifx-3.0.6.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
997650a293289243e1ffb0aa702047bf3973912edfdd64428e40848915afc10e
BLAKE2b-256 checksum
How to use checksums
e22fcfd3d85da60f3ed150626a7d645647303ed70c3b87ea530f16356f5a07ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / adafruit_circuitpython_lifx-3.0.6-py3-none-any.whl

Download URL adafruit_circuitpython_lifx-3.0.6-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f5218db066c245b22392c11a90b67d8c9a3ad5281fe487dbab38811591d399b
BLAKE2b-256 checksum
How to use checksums
86106b97a11f8679a912f76c6378e3de6b25170a3389609f36b59b2e3cbac251
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

3.0.6 This release

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.10.8

2 release files

1.10.7

2 release files

1.10.5

1 release file

1.10.4

1 release file

1.10.3

1 release file

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.5

1 release file

1.9.4

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page