studioimaginaire/phue — pull request #3 by mperrin (2013-02-09 07:43:56+00:00)
Title: Some contributions to phue

Thanks for a very nice package! I really appreciate the clean property-based interface to getting and setting light parameters. I've made a handful of enhancements which I hope you may find of use. Cheers!

* Added bracketed index access to lights via `__getitem__`

```python
>>> b = phue.Bridge(bridgeip)
>>> light0 = b[0] # starts with 0, pythonicly
```
or also
```
>>> light0 = b['Kitchen'] #works too, assuming valid name
```

* logging using Python's logging module, including error checking and display

I saw that your TODO file listed "implement real logging instead of print", so I did that. :-) I also set it up to log any errors encountered when trying to set parameters:
```
>>> light.brightness = 300
WARNING:phue:ERROR: invalid value, 300, for parameter, bri for light 1
```

* add attribute for color temp in Kelvin
```
>>> light.colortemp = 300
>>> light.colortemp_k
333
>>> light.colortemp_k = 4500
(light becomes higher color temp)
```

* add some more details in docstrings here and there