Skip to content

Commit 8f7a716

Browse files
committed
add update_x_passphrase
1 parent 78174d5 commit 8f7a716

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ pip-selfcheck.json
1010
Lib/
1111
.tox/
1212
.vscode/
13+
.idea

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ Powers On the given port on the Switch identified by the given MAC Address.
248248
- `target_mac` -- MAC address of the device
249249
- `port_idx` -- Port ID to power on
250250

251+
### `update_x_passphrase(self, wlan_id, x_passphrase)`
252+
updates the Password of the given WLAN
253+
- `wlan_id` -- the WLANs ID
254+
- `x_passphrase` -- the new Password to set
255+
251256
Utilities
252257
---------
253258

pyunifi/controller.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,17 @@ def update_setting(self, settings):
753753
res.extend(self._api_write("set/setting/" + sect, setting))
754754
return res
755755

756+
def update_x_passphrase(self, wlan_id, x_passphrase):
757+
"""
758+
Update WLAN password
759+
760+
:param wlan_id: WLAN ID of the WLAN the password should be changed
761+
:param x_passphrase: The new password
762+
:return: the updated wlan_conf
763+
"""
764+
res = self._api_update("rest/wlanconf/" + wlan_id, {"x_passphrase": x_passphrase})
765+
return res
766+
756767
def update_user_group(self, group_id, down_kbps=-1, up_kbps=-1):
757768
"""
758769
Update user group bandwidth settings

0 commit comments

Comments
 (0)