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 set_wlan_conf #45

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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
11 changes: 11 additions & 0 deletions pyunifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down