python-unifi-client 1.1.2__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/PKG-INFO +1 -1
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client/client.py +9 -6
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/PKG-INFO +1 -1
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/setup.py +1 -1
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/README.md +0 -0
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client/__init__.py +0 -0
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/SOURCES.txt +0 -0
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/dependency_links.txt +0 -0
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/top_level.txt +0 -0
- {python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/setup.cfg +0 -0
|
@@ -10,9 +10,7 @@ import http.client as http_client
|
|
|
10
10
|
import logging
|
|
11
11
|
import base64
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
logging.getLogger('requests.packages.urllib3').setLevel(logging.DEBUG)
|
|
15
|
-
http_client.HTTPConnection.debuglevel = 1
|
|
13
|
+
|
|
16
14
|
|
|
17
15
|
# Custom exceptions mirroring PHP equivalents
|
|
18
16
|
class CurlExtensionNotLoadedException(Exception):
|
|
@@ -81,7 +79,7 @@ class Client:
|
|
|
81
79
|
CURL_METHODS_ALLOWED = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']
|
|
82
80
|
DEFAULT_CURL_METHOD = 'GET'
|
|
83
81
|
|
|
84
|
-
def __init__(self, user, password, baseurl='https://32.218.193.188', site='default', version='8.0.28', ssl_verify=False, unificookie_name='unificookie'):
|
|
82
|
+
def __init__(self, user, password, baseurl='https://32.218.193.188', site='default', version='8.0.28', ssl_verify=False, unificookie_name='unificookie', debug=False):
|
|
85
83
|
# Initial setup mirrors PHP constructor
|
|
86
84
|
self._check_curl()
|
|
87
85
|
self._check_base_url(baseurl)
|
|
@@ -109,7 +107,12 @@ class Client:
|
|
|
109
107
|
self._last_results_raw = None
|
|
110
108
|
self._cookies_created_at = 0
|
|
111
109
|
self._exec_retries = 0
|
|
112
|
-
self.debug =
|
|
110
|
+
self.debug = debug
|
|
111
|
+
|
|
112
|
+
if self.debug:
|
|
113
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
114
|
+
logging.getLogger('requests.packages.urllib3').setLevel(logging.DEBUG)
|
|
115
|
+
http_client.HTTPConnection.debuglevel = 1
|
|
113
116
|
|
|
114
117
|
self._curl_headers = {
|
|
115
118
|
'Accept': 'application/json',
|
|
@@ -1835,7 +1838,7 @@ class Client:
|
|
|
1835
1838
|
"""Generate a controller backup for the past N days."""
|
|
1836
1839
|
payload = {'cmd': 'backup', 'days': days}
|
|
1837
1840
|
result = self.fetch_results(f"/proxy/network/api/s/{self._site}/cmd/backup", payload=payload, prefix_path=False, boolean=False)
|
|
1838
|
-
print(f"RAW RESULT FROM FETCH_RESULTS(): {result}")
|
|
1841
|
+
print(f"RAW RESULT FROM FETCH_RESULTS(): {result}") if self.debug else None
|
|
1839
1842
|
return result
|
|
1840
1843
|
|
|
1841
1844
|
def download_backup(self, filepath: str):
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="python_unifi_client",
|
|
8
|
-
version="1.
|
|
8
|
+
version="1.2.0",
|
|
9
9
|
author="Michael Lapinski",
|
|
10
10
|
author_email="michaellapinski787@gmail.com",
|
|
11
11
|
descripton="A python version of a github Art-of-Wifi/Unifi-API-Client",
|
|
File without changes
|
|
File without changes
|
{python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_unifi_client-1.1.2 → python_unifi_client-1.2.0}/python_unifi_client.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|