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
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://firstname.lastname@example.org
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)
- connection management
- high- and low-level interfaces for sending and receiving data
- callback-based, non-blocking, and blocking APIs
- no dependencies other than Python
Not much here yet, sadly, but the code is fairly well-documented. See the docstrings, or check out the examples directory.
pip install -r dev_requirements.txt flake8 *.py && nosetests
lifxjs Protocol wiki page was particularly helpful in
the creation of this package.
Licensed under the MIT license. See the LICENSE file for the full text.