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). 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})