Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add update_x_passphrase #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pip-selfcheck.json
Lib/
.tox/
.vscode/
.idea
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ Powers On the given port on the Switch identified by the given MAC Address.
- `target_mac` -- MAC address of the device
- `port_idx` -- Port ID to power on

### `update_x_passphrase(self, wlan_id, x_passphrase)`
updates the Password of the given WLAN
- `wlan_id` -- the WLANs ID
- `x_passphrase` -- the new Password to set

Utilities
---------

Expand Down
12 changes: 12 additions & 0 deletions pyunifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,18 @@ def update_setting(self, settings):
res.extend(self._api_write("set/setting/" + sect, setting))
return res

def update_x_passphrase(self, wlan_id, x_passphrase):
"""
Update WLAN password

:param wlan_id: WLAN ID of the WLAN the password should be changed
:param x_passphrase: The new password
:return: the updated wlan_conf
"""
res = self._api_update("rest/wlanconf/" + wlan_id,
{"x_passphrase": x_passphrase})
return res

def update_user_group(self, group_id, down_kbps=-1, up_kbps=-1):
"""
Update user group bandwidth settings
Expand Down