create_new_username throws "AttributeError: 'int' object has no attribute 'post'" [Python 3.8]
Closed this issue · 1 comments
alexcooperdev commented
As the title states, running the latest version of qhue
throws an attribute error when trying to create a username using the designated function.
Console output:
Press the Bridge button, then press Return:
*return pressed*
Traceback (most recent call last):
File "/path/to/project/main.py", line 6, in <module>
user = create_new_username(hue_ip)
File "/path/to/project/venv/lib/python3.8/site-packages/qhue/qhue.py", line 117, in create_new_username
response = res(devicetype=devicetype, http_method="post")
File "/path/to/project/venv/lib/python3.8/site-packages/qhue/qhue.py", line 57, in __call__
r = self.session.post(url, data=json.dumps(kwargs, default=list), timeout=self.timeout)
AttributeError: 'int' object has no attribute 'post'
Process finished with exit code 1
Script used:
from qhue import create_new_username
hue_ip = "192.168.x.x"
username=None
if username is None:
username = create_new_username(hue_ip)
print("New user: {} . Put this in the username variable above.".format(username))
quentinsf commented
Should be fixed in 2.0.1