From d8438ba042fc24c0d7398e35b6c513c502bd8fe7 Mon Sep 17 00:00:00 2001 From: Tertius Carstens Date: Wed, 25 Sep 2019 08:00:43 -0500 Subject: [PATCH 1/2] add set_wlan_conf --- pyunifi/controller.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyunifi/controller.py b/pyunifi/controller.py index fe9eeb2..1b1912a 100644 --- a/pyunifi/controller.py +++ b/pyunifi/controller.py @@ -231,6 +231,17 @@ def get_wlan_conf(self): """ return self._api_read('list/wlanconf') + def set_wlan_conf(self, wlan_id, x_password, name=None): + """ + Update WLAN configuration + + :param wlan_id: id of wlan: '' + :param x_password: new password for WLAN + :param name: new name (SSID) for WLAN + """ + params = {'x_passphrase': x_password, 'name': name} + return self._api_write('upd/wlanconf/' + str(wlan_id), params) + def _run_command(self, command, params={}, mgr='stamgr'): log.debug('_run_command(%s)', command) params.update({'cmd': command}) From 3924333327dcb3c8a95e3fef118c24f4cde34c04 Mon Sep 17 00:00:00 2001 From: Tertius Carstens Date: Wed, 25 Sep 2019 17:59:49 -0500 Subject: [PATCH 2/2] add set_wlan_conf documentation --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index fae8c72..df43194 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,14 @@ Return high level health information on status of the setup Return a list of configured WLANs with their configuration parameters. +### `set_wlan_conf(self, wlan_id, x_password, name=None)` + +Update WLAN settings for indivual WLANs. + +- `wlan_id` -- WLAN ID to modify. +- `x_password` -- New WLAN password. +- `name` -- New WLAN SSID. + ### `restart_ap(self, mac)` Restart an access point (by MAC).