Skip to content

Commit

Permalink
Documentation layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Nov 15, 2012
1 parent 4880d69 commit bae16dd
Showing 1 changed file with 17 additions and 38 deletions.
55 changes: 17 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ unifi-api
A rewrite of https://github.com/unifi-hackers/unifi-lab in cleaner Python.

Install
=======
-------

sudo pip install -U unifi

Example
=======
-------

```python
from unifi.controller import Controller
Expand All @@ -18,11 +18,13 @@ for ap in c.get_aps():
print 'AP named %s with MAC %s' % (ap['name'], ap['mac'])
```

See also the scripts `unifi-ls-clients` and `unifi-low-rssi-reconnect` for more
examples of how to use the API.

API
===
---

`class Controller`
------------------
### `class Controller`

Interact with a UniFi controller.

Expand All @@ -31,82 +33,59 @@ controller. Operations will raise unifi.controller.APIError on obvious
problems (such as login failure), but many errors (such as disconnecting a
nonexistant client) will go unreported.

`__init__(self, host, username, password)`
------------------------------------------
### `__init__(self, host, username, password)`

Create a Controller object.

### Arguments:

- `host` -- the address of the controller host; IP or name
- `username` -- the username to log in with
- `password` -- the password to log in with

`block_client(self, mac)`
-------------------------
### `block_client(self, mac)`

Add a client to the block list.

### Arguments:

- `mac` -- the MAC address of the client to block.

`disconnect_client(self, mac)`
------------------------------

Disconnect a client.
### `disconnect_client(self, mac)`

Disconnects a client, forcing them to reassociate. Useful when the
connection is of bad quality to force a rescan.

### Arguments:

- `mac` -- the MAC address of the client to disconnect.

`get_aps(self)`
---------------
### `get_aps(self)`

Return a list of all AP:s, with significant information about each.

`get_clients(self)`
-------------------
### `get_clients(self)`

Return a list of all active clients, with significant information about each.

`get_wlan_conf(self)`
---------------------
### `get_wlan_conf(self)`

Return a list of configured WLANs with their configuration parameters.

`restart_ap(self, mac)`
-----------------------
### `restart_ap(self, mac)`

Restart an access point (by MAC).

### Arguments:

- `mac` -- the MAC address of the AP to restart.

`restart_ap_name(self, name)`
-----------------------------
### `restart_ap_name(self, name)`

Restart an access point (by name).

### Arguments:

- `name` -- the name address of the AP to restart.

`unblock_client(self, mac)`
---------------------------
### `unblock_client(self, mac)`

Remove a client from the block list.

### Arguments:

- `mac` -- the MAC address of the client to unblock.

License
=======
-------

MIT

0 comments on commit bae16dd

Please sign in to comment.