Skip to content

Commit

Permalink
Support v5 controller
Browse files Browse the repository at this point in the history
  • Loading branch information
candlerb committed Sep 23, 2016
1 parent 5638cf5 commit 37fe6d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions unifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, host, username, password, port=8443, version='v2', site_id='d
username -- the username to log in with
password -- the password to log in with
port -- the port of the controller host
version -- the base version of the controller API [v2|v3|v4]
version -- the base version of the controller API [v2|v3|v4|v5]
site_id -- the site ID to connect to (UniFi >= 3.x)
"""
Expand Down Expand Up @@ -137,6 +137,8 @@ def _construct_api_path(self, version):
return V3_PATH
if(version == 'v4'):
return V3_PATH
if(version == 'v5'):
return V3_PATH
else:
return V2_PATH

Expand All @@ -146,7 +148,7 @@ def _login(self, version):
params = {'username': self.username, 'password': self.password}
login_url = self.url

if version == 'v4':
if version == 'v4' or version == 'v5':
login_url += 'api/login'
params = json.dumps(params)
else:
Expand Down

0 comments on commit 37fe6d8

Please sign in to comment.