Closed sdague closed 7 years ago
Yes, that would be great !
Cool, I'll start in on that this evening if I get a chance. I'm also curious how important the single file / no dependencies is on the functional side. When I was playing with flake8 on the code the way 2/3 support is done makes it a bit sad, because unicode doesn't exist as a function in python 3. Using six for those kinds of parts would definitely make linting happier as well.
The main reason for single file/no dependencies is to make it easy to run with Pythonista on iOS or various Android python interpreters.
I agree that the unicode/p3k support could be improved...
Started working on this here - https://github.com/studioimaginaire/phue/pull/75
However, given the number of HTTP requests happening behind the scenes (like the fact that Light name is dynamic) manually mocking the request method is getting a bit wonky. It's a start, but man using requests/requests-mock would be so much simpler here. :)
I think I came up with a workable patching of HTTPConnection to make life easier there, in last patch
I've started hacking on this for some features I'd really like in home-assistant. The fact that the code doesn't have any tests makes it quite easy to break by accident on new patches.
I'd be happy to start building up some tests and connect this to the travis infrastructure if there is upstream interest. Please let me know, and I'll start in on that work.
Thanks again for this great base library. Hoping to help make it even better.