From 570470cfc092078b431c7480d97d139ab76325d1 Mon Sep 17 00:00:00 2001 From: Riley Date: Mon, 13 Jul 2020 12:25:13 -0400 Subject: [PATCH] Added an example --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 197a145..8b62e76 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # API Ubiquity UniFi Controller + +```python +c = controller.Controller(host="192.168.1.246") +c.username = "your_username" +c.password = "your_password" + +print(c.logged_in) #False +c.connect() + +print(c.logged_in) #True +clients = c.get_clients() + +for client in clients: + if "hostname" in client: +print("Hostname: " + client["hostname"]) +print("OUI: " + client["oui"]) +print("Network: " + client["network"]) +``` + +There are other functions than get_clients(). + +``` + authorize_guest() disconnect() get_clients() get_users() logged_in reconnect_sta() unblock_sta() + block_sta() forget_sta() get_events() get_wlan_conf() password site username + connect() get_aps() get_user_groups() host port unauthorize_guest() version + function(mac, minutes, up=None, down=None, mbytes=None, ap_mac=None) + +