From 66e9f92148e1a854ede5617091a386377ca9fb45 Mon Sep 17 00:00:00 2001 From: Heiko Ritter Date: Mon, 25 Feb 2019 13:45:44 +0100 Subject: [PATCH] add update_x_passphrase --- .gitignore | 1 + README.md | 5 +++++ pyunifi/controller.py | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index e82a672..7080643 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ pyunifi.egg-info pyvenv.cfg pip-selfcheck.json Lib/ +.idea diff --git a/README.md b/README.md index a581ca6..66600c3 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,11 @@ Set client alias. Use "" to reset to the default. - mac: The target MAC: aa:bb:cc:dd:ee:ff - alias: The alias to set +### `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 --------- diff --git a/pyunifi/controller.py b/pyunifi/controller.py index ee5d9b9..b456a11 100644 --- a/pyunifi/controller.py +++ b/pyunifi/controller.py @@ -465,6 +465,17 @@ 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