Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few updates to make the code compatible with firmware 2.0 #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

amil109
Copy link

@amil109 amil109 commented Jul 7, 2015

Hi there,

Thanks for writing this great repo! I find your code much easier to follow than other python LIFX code I could find, and it was working just fine with only a couple of minor changes to make it Python 2.7 compatible (I run it on an Arduino Yun which has 2.7 - Python 3.x should still work fine) until my bulbs got updated to firmware 2.0, when the protocol became an issue. I've added a line to the methods to change the protocol to the individual bulb mode if the target is a single bulb.

Also, my setup has 7 bulbs throughout the apartment, and they always seem to form multiple gateways, so I had to change the code a bit to create multiple gateways during connection to get them all to work correctly. All commands are sent to each gateway, even if the relevant bulb is not attached, so that could probably be improved (it maybe slows things down), but it seems to work OK right now.

Please have a look and see if you think it is worthwhile integrating my code - it's been a while since I wrote anything others had to see (and my first time contributing on GitHub), so I apologise if the style is no good!

Cheers,

Mills

Review on Reviewable

amil109 added 5 commits July 5, 2015 01:23
commands, but retain 0x3400 for all broadcast commands. This seems to be
a requirement of the protocol from firmware 2.x onwards.
Remove utf-8 formatting from __str__ methods to work with Python 2.x.
Add debug flags to each module.
Add with_label method to allow lights to be picked by their label.
Added ALL global variable in lifx.py to allow manipulation of all lights
at once.
commands, but retain 0x3400 for all broadcast commands. This seems to be
a requirement of the protocol from firmware 2.x onwards.
Remove utf-8 formatting from __str__ methods to work with Python 2.x.
Add debug flags to each module.
Add with_label method to allow lights to be picked by their label.
Added ALL global variable in lifx.py to allow manipulation of all lights
at once.
Update lights_on.py and lights_off.py to show the bulb by bulb feature.
@sharph
Copy link
Owner

sharph commented Jul 11, 2015

Awesome! To be honest I've been too lazy and careless to investigate the 2.0 change that broke everything and I've been hoping that someone who cared would step up and fix everything.

I'll see if I can test this out this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants