From bae16dd360e26861403440138ae0628f04c084ba Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 15 Nov 2012 10:13:14 +0100 Subject: [PATCH] Documentation layout. --- README.md | 55 +++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index af8010b..828c00b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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