-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added brightness and scenes functionality for Vera lights #1
Conversation
Added functionality for brightness and scenes. Possible I left in some formatting problems. Also, listScenes() is broken, there is some documentation of what is wrong with in-line comments.
self.id = id | ||
self.name = name | ||
self.room = room | ||
self.state = state | ||
self.hasBrightness = hasBrightness |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasBrightness seems to be redundant. We can check if brightness was None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure; I've been writing a lot of Java lately so I've gotten my mind out of the duck-typing game. I will make the adjustment.
Thanks for working on this @ug2215 ! If you can make the change above, I can go ahead and merge it :) |
I removed hasBrightness Then I noticed that brightness isn't really a property of "Devices", but "Lights", and so moved them. I left in that last "pass" because it didn't seem to hurt anything and I'm not real clear on how inheritance works in Python. Also ID'd a bug I had introduced in deviceDecoder(dct). I tried to fix it but am not sure how to test.
pass was not necessary added a response for a light without brightness that it should have received a request to change brightness
Added brightness and scenes functionality for Vera lights
thanks for doing this! upon closer inspection, i probably would send the brightness info in the lights endpoint together with the state since this design isnt exactly very RESTful, but maybe i'll revisit this again later :) |
The changes are actually much less substantial than git is showing. I had some formatting problems going from my Windows environment to my Linux server and got a bit overzealous with my formatting corrections. In particular, I replaced all tabs with 4 spaces.
But yeah, reasonably self-explanatory upgrades. I used all of your style as relevant.
I also added a lot to the README because I had a very hard time getting started. I had never used Flask, or whatever it is that turns Python into a webserver. I tried to hook up it in CGI style... and yeah that took a while screwing around to figure out why it would the web request thread would run forever.
I am using an HTML/JS web interface but as mentioned in the README, don't really want to share it because I license it to a company I own and that would get all wonky. If you do circle back to this project AND work on a generic web interface instead of an Android app I would be willing to contribute a bit.