You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for periodic requests to the unifi controller I made a script that logs in, fetches the required data and logs out. Everything works up to calling client.logout(), then I get the following:
Traceback (most recent call last):
File "test.py", line 12, in
client.logout()
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/metaprogram.py", line 125, in wrapper
return instance(client, *a, **kw)
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/metaprogram.py", line 103, in call
return client._execute(url, self._method, rest_dict, need_login=self._need_login)
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/unifi.py", line 115, in _execute
raise UnifiTransportError("{}: {}".format(resp.status_code, resp.reason))
unificontrol.exceptions.UnifiTransportError: 400:
Running the unifi controller on a raspberry pi, controller version: 6.0.45. Python 3.7
The text was updated successfully, but these errors were encountered:
Hmm... I'm having the same issue right now. It's a bit perplexing. It sounds stupid but honestly I found it easiest to just delete the current client, and recreate it. I need to actually test it out with multiple controllers, as my use case it like five of them, but so far it seems I'm able to log in, delete the client, re-initialize it, and it works just fine. Not sure if I'll run into any issues but if I do I will write it down here.
I had the same issue with the logout function. I compared the function call to the PHP version and the PHP version uses the POST method. This library uses the GET message.
Adding method="post", to the definition fixed it for me.
Hey,
for periodic requests to the unifi controller I made a script that logs in, fetches the required data and logs out. Everything works up to calling client.logout(), then I get the following:
Traceback (most recent call last):
File "test.py", line 12, in
client.logout()
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/metaprogram.py", line 125, in wrapper
return instance(client, *a, **kw)
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/metaprogram.py", line 103, in call
return client._execute(url, self._method, rest_dict, need_login=self._need_login)
File "/home/sensor_bot/.local/share/virtualenvs/sensor_bot-ejTj32CH/lib/python3.7/site-packages/unificontrol/unifi.py", line 115, in _execute
raise UnifiTransportError("{}: {}".format(resp.status_code, resp.reason))
unificontrol.exceptions.UnifiTransportError: 400:
Running the unifi controller on a raspberry pi, controller version: 6.0.45. Python 3.7
The text was updated successfully, but these errors were encountered: