From 4b797c19c59f99dd363ffc197c856c7d1ac7345e Mon Sep 17 00:00:00 2001 From: Frak Date: Wed, 29 Jan 2020 02:05:14 -0500 Subject: [PATCH 1/2] Use the 2.0 branch for pip install --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0933e45..d8659a9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Lazylights is a Python API for controlling Lifx bulbs. To install, ```shell -pip install git+https://github.com/mpapi/lazylights +pip install git+https://github.com/mpapi/lazylights@2.0 ``` Then, in Python, From e3293d8ad77a30831bddf8009df4c50b60aa85c4 Mon Sep 17 00:00:00 2001 From: Frak Date: Wed, 20 May 2020 07:40:51 -0400 Subject: [PATCH 2/2] Support python 3 Changed instances of '\x' to b'\x' --- lazylights.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lazylights.py b/lazylights.py index 9ca2e4b..4382d21 100644 --- a/lazylights.py +++ b/lazylights.py @@ -10,7 +10,7 @@ _SOCKET_BUFFER_SIZE = 65536 -ALL_BULBS = '\x00' * 6 +ALL_BULBS = b'\x00' * 6 LIFX_PORT = 56700 ADDR_BROADCAST = ('255.255.255.255', LIFX_PORT) @@ -163,7 +163,7 @@ def set_power(bulbs, is_on): otherwise. """ _send(bulbs, REQ_SET_POWER_STATE, '2s', - '\xff\xff' if is_on else '\x00\x00') + b'\xff\xff' if is_on else b'\x00\x00') def set_state(bulbs, hue, saturation, brightness, kelvin, fade, raw=False):