quentinsf/qhue

Couple Suggestions

691175002 opened this issue · 1 comments

I really like how you've designed this package. Very concise, and since its a direct translation of the Hue API you only need to read one set of docs. Here are a few things that came up while I've been using it.

create_new_username() is not py3 compatible as raw_input has been renamed.

I've been working a bit with rules and schedules, do you think something like this would be worth adding?

def __init__(self, url, timeout=_DEFAULT_TIMEOUT):
    self.url = url
    self.address = url[url.find('/api'):]
    self.timeout = timeout

Usage would be for situations like this, its even uglier with format()

b.schedules(name='Schedule',
            command={'address':'/api/36fb185bce3dfaf30ea836337e03537/lights/5/state',
                     ...

b.schedules(name='Schedule',
            command={'address':b.lights[5].address,
                     ...

Hi Ryan - yes, I like that, and I've made the raw_input bit Py3-compatible too.

v1.0.2 is now on PyPI with these changes.

Thanks!