quentinsf/qhue

AttributeError

Closed this issue · 2 comments

Hey, i have read the instructions and i try to run the very basics below.

from qhue import create_new_username
username = create_new_username("192.168.1.136")

But i recieved the following.

Traceback (most recent call last):
File "gpu_temp.pty", line 2, in
username = create_new_username("192.168.1.136")
File "C:\Python27\lib\site-packages\qhue\qhue.py", line 70, in create_new_username
res = Resource(_api_url(ip), timeout)
File "C:\Python27\lib\site-packages\qhue\qhue.py", line 21, in init
self.short_address = re.search(r'/api/[^/](.)', url).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Perhaps a bug?

Ah yes, you're quite right. create_new_username doesn't get as much testing as it deserves because most people don't need to do it after the first time!

Will try to fix this shortly. If you're not using short_address for anything you could just comment that line out for now.

Thanks!

Q

Fixed in 1.0.8