Skip to content
A Python API for controlling Lifx bulbs.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Initial commit. Jan 12, 2014
.gitignore Initial commit. Jan 12, 2014
LICENSE Initial commit. Jan 12, 2014
README.md Update the README to point to the 2.0 branch. Feb 6, 2015
dev_requirements.txt Initial commit. Jan 12, 2014
lazylights.py Updates for new protocol. Aug 11, 2014
setup.py Initial commit. Jan 12, 2014
test_lazylights.py Initial commit. Jan 12, 2014

README.md

Lazylights

Lazylights is a Python API for controlling Lifx bulbs.

Support for 2.0 is on a branch

What's running on the master branch is deprecated -- see the 2.0 branch with a much simpler API for working with bulbs with the 2.0 firmware.

Until that's merged and on PyPI:

pip install git+https://github.com/mpapi/lazylights@2.0

Quick start

To install,

pip install git+https://github.com/mpapi/lazylights

Then, in Python,

from lazylights import Lifx
import time

lifx = Lifx(num_bulbs=2)  # so it knows how many to wait for when connecting

@lifx.on_connected
def _connected():
    print "Connected!"

with lifx.run():
    lifx.set_power_state(True)
    time.sleep(1)
    lifx.set_power_state(False)

Features

  • connection management
  • high- and low-level interfaces for sending and receiving data
  • callback-based, non-blocking, and blocking APIs
  • no dependencies other than Python

Documentation

Not much here yet, sadly, but the code is fairly well-documented. See the docstrings, or check out the examples directory.

Hacking

pip install -r dev_requirements.txt
flake8 *.py && nosetests

Credits

The lifxjs Protocol wiki page was particularly helpful in the creation of this package.

License

Licensed under the MIT license. See the LICENSE file for the full text.

You can’t perform that action at this time.