tplinkrouterc6u 5.0.3__py3-none-any.whl → 5.1.0__py3-none-any.whl
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.
- test/test_client_ex.py +339 -0
- test/test_client_mr.py +185 -0
- tplinkrouterc6u/__init__.py +13 -12
- tplinkrouterc6u/client/__init__.py +1 -0
- tplinkrouterc6u/client/api_cgi_bin.py +435 -0
- tplinkrouterc6u/client/c1200.py +102 -0
- tplinkrouterc6u/client/c5400x.py +109 -0
- tplinkrouterc6u/client/c6v4.py +38 -0
- tplinkrouterc6u/client/deco.py +177 -0
- tplinkrouterc6u/client/ex.py +295 -0
- tplinkrouterc6u/client/mr.py +645 -0
- tplinkrouterc6u/client_abstract.py +48 -0
- tplinkrouterc6u/common/__init__.py +1 -0
- tplinkrouterc6u/{dataclass.py → common/dataclass.py} +12 -1
- tplinkrouterc6u/provider.py +37 -0
- {tplinkrouterc6u-5.0.3.dist-info → tplinkrouterc6u-5.1.0.dist-info}/METADATA +16 -1
- tplinkrouterc6u-5.1.0.dist-info/RECORD +28 -0
- {tplinkrouterc6u-5.0.3.dist-info → tplinkrouterc6u-5.1.0.dist-info}/WHEEL +1 -1
- tplinkrouterc6u/client.py +0 -1451
- tplinkrouterc6u-5.0.3.dist-info/RECORD +0 -17
- /tplinkrouterc6u/{encryption.py → common/encryption.py} +0 -0
- /tplinkrouterc6u/{exception.py → common/exception.py} +0 -0
- /tplinkrouterc6u/{helper.py → common/helper.py} +0 -0
- /tplinkrouterc6u/{package_enum.py → common/package_enum.py} +0 -0
- {tplinkrouterc6u-5.0.3.dist-info → tplinkrouterc6u-5.1.0.dist-info}/LICENSE +0 -0
- {tplinkrouterc6u-5.0.3.dist-info → tplinkrouterc6u-5.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from macaddress import EUI48
|
|
2
2
|
from ipaddress import IPv4Address
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from tplinkrouterc6u.common.package_enum import Connection
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
@dataclass
|
|
@@ -246,3 +247,13 @@ class IPv4Status:
|
|
|
246
247
|
@property
|
|
247
248
|
def lan_ipv4_netmask_address(self):
|
|
248
249
|
return self._lan_ipv4_netmask
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
@dataclass
|
|
253
|
+
class SMS:
|
|
254
|
+
def __init__(self, index: int, sender: str, content: str, received_at: datetime, unread: bool) -> None:
|
|
255
|
+
self.id = index
|
|
256
|
+
self.sender = sender
|
|
257
|
+
self.content = content
|
|
258
|
+
self.received_at = received_at
|
|
259
|
+
self.unread = unread
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from logging import Logger
|
|
2
|
+
from tplinkrouterc6u.common.exception import ClientException, AuthorizeError
|
|
3
|
+
from tplinkrouterc6u.client.api_cgi_bin import TplinkRouter
|
|
4
|
+
from tplinkrouterc6u.client.deco import TPLinkDecoClient
|
|
5
|
+
from tplinkrouterc6u.client_abstract import AbstractRouter
|
|
6
|
+
from tplinkrouterc6u.client.mr import TPLinkMRClient
|
|
7
|
+
from tplinkrouterc6u.client.ex import TPLinkEXClient
|
|
8
|
+
from tplinkrouterc6u.client.c6v4 import TplinkC6V4Router
|
|
9
|
+
from tplinkrouterc6u.client.c5400x import TplinkC5400XRouter
|
|
10
|
+
from tplinkrouterc6u.client.c1200 import TplinkC1200Router
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TplinkRouterProvider:
|
|
14
|
+
@staticmethod
|
|
15
|
+
def get_client(host: str, password: str, username: str = 'admin', logger: Logger = None,
|
|
16
|
+
verify_ssl: bool = True, timeout: int = 30) -> AbstractRouter:
|
|
17
|
+
for client in [TplinkC5400XRouter, TPLinkEXClient, TPLinkMRClient, TplinkC6V4Router, TPLinkDecoClient,
|
|
18
|
+
TplinkRouter]:
|
|
19
|
+
router = client(host, password, username, logger, verify_ssl, timeout)
|
|
20
|
+
if router.supports():
|
|
21
|
+
return router
|
|
22
|
+
|
|
23
|
+
router = TplinkC1200Router(host, password, username, logger, verify_ssl, timeout)
|
|
24
|
+
try:
|
|
25
|
+
router.authorize()
|
|
26
|
+
return router
|
|
27
|
+
except AuthorizeError as e:
|
|
28
|
+
if logger:
|
|
29
|
+
logger.error(e.__str__())
|
|
30
|
+
raise ClientException(('Login failed! Please check if your router local password is correct or '
|
|
31
|
+
'try to use web encrypted password instead. Check the documentation!'
|
|
32
|
+
))
|
|
33
|
+
except Exception as e:
|
|
34
|
+
if logger:
|
|
35
|
+
logger.error(e.__str__())
|
|
36
|
+
raise ClientException('Try to use web encrypted password instead. Check the documentation! '
|
|
37
|
+
+ e.__str__())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.0
|
|
3
|
+
Version: 5.1.0
|
|
4
4
|
Summary: TP-Link Router API
|
|
5
5
|
Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
|
|
6
6
|
Author: Alex Erohin
|
|
@@ -44,6 +44,7 @@ from tplinkrouterc6u import (
|
|
|
44
44
|
TplinkC1200Router,
|
|
45
45
|
TplinkC5400XRouter,
|
|
46
46
|
TPLinkMRClient,
|
|
47
|
+
TPLinkEXClient,
|
|
47
48
|
TPLinkDecoClient,
|
|
48
49
|
Connection
|
|
49
50
|
)
|
|
@@ -107,6 +108,10 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
107
108
|
| get_ipv4_dhcp_leases | | Gets IPv4 addresses assigned via DHCP | [[IPv4DHCPLease]](#IPv4DHCPLease) |
|
|
108
109
|
| set_wifi | wifi: [Connection](#connection), enable: bool | Allow to turn on/of 4 wifi networks | |
|
|
109
110
|
| send_sms | phone_number: str, message: str | Send sms for LTE routers | |
|
|
111
|
+
| send_ussd | command: str | Send USSD command for LTE routers | str |
|
|
112
|
+
| get_sms | | Get sms messages from the first page for LTE routers | [[SMS]](#sms) |
|
|
113
|
+
| set_sms_read | sms: [SMS](#sms) | Set sms message read from the first page for LTE routers | |
|
|
114
|
+
| delete_sms | sms: [SMS](#sms) | Delete sms message from the first page for LTE routers | |
|
|
110
115
|
| reboot | | reboot router |
|
|
111
116
|
| authorize | | authorize for actions |
|
|
112
117
|
| logout | | logout after all is done |
|
|
@@ -210,6 +215,15 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
210
215
|
| lan_ipv4_netmask_address | router LAN gateway IP netmask | ipaddress |
|
|
211
216
|
| remote | router remote | bool, None |
|
|
212
217
|
|
|
218
|
+
### <a id="sms">SMS</a>
|
|
219
|
+
| Field | Description | Type |
|
|
220
|
+
| --- |---|---|
|
|
221
|
+
| id | message index | int |
|
|
222
|
+
| sender| sender | str |
|
|
223
|
+
| content| sms text | str |
|
|
224
|
+
| received_at| received datetime | datetime |
|
|
225
|
+
| unread| is message unread | bool |
|
|
226
|
+
|
|
213
227
|
## Enum
|
|
214
228
|
### <a id="connection">Connection</a>
|
|
215
229
|
- Connection.HOST_2G - host wifi 2.4G
|
|
@@ -271,6 +285,7 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
271
285
|
- Deco X60 V3
|
|
272
286
|
- Deco X90
|
|
273
287
|
- Deco XE75 (v1.0, v2.0)
|
|
288
|
+
- EX511 v2.0
|
|
274
289
|
- TD-W9960 (v1, V1.20)
|
|
275
290
|
- TL-MR100 v2.0
|
|
276
291
|
- TL-MR105
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
test/__init__.py,sha256=McQmUjeN3AwmwdS6QNfwGXXE77OKoPK852I2BM9XsrU,210
|
|
2
|
+
test/test_client.py,sha256=8cK4qnheszu-zpUJqttKp5Z5WJXrQy1t_fMzMzNnmvw,30638
|
|
3
|
+
test/test_client_c1200.py,sha256=O6NK9uXIEb_vks6lI3g7j6q8TYJ9MSDFYzGA_wOBhOA,4620
|
|
4
|
+
test/test_client_deco.py,sha256=ur4u-pWB-6WaYW6PSpK9OvCg3rfo2x06V5Cf_eE2UYU,30447
|
|
5
|
+
test/test_client_ex.py,sha256=cSIMh6yjiAknt0mk7u1dCpXVzZTR_Y95XvXRBRusbpg,17092
|
|
6
|
+
test/test_client_mr.py,sha256=xdrcOnnhDWp7BBAUrtBf9I7y6H6q5ZnYz3iz0T3hTDw,28666
|
|
7
|
+
tplinkrouterc6u/__init__.py,sha256=HU1JG5MaM_k5J6D2tV_zqhGA2SpGQ2j44K4RE4turfw,818
|
|
8
|
+
tplinkrouterc6u/client_abstract.py,sha256=OgftTH6bELzhFWom0MOX4EJe3RNS003ezpHyyRnh2tQ,1328
|
|
9
|
+
tplinkrouterc6u/provider.py,sha256=TYnpQiLU1IcTd1x9kJenZ5AREgkpWzDJkSai_hfPPEk,1846
|
|
10
|
+
tplinkrouterc6u/client/__init__.py,sha256=KBy3fmtA9wgyFrb0Urh2x4CkKtWVnESdp-vxmuOvq0k,27
|
|
11
|
+
tplinkrouterc6u/client/api_cgi_bin.py,sha256=zzGkdooPopVwcNVpqQ3rbsa7pfjLrgqPQVuV9PFKfY4,17309
|
|
12
|
+
tplinkrouterc6u/client/c1200.py,sha256=4XEYidEGmVIJk0YQLvmTnd0Gqa7glH2gUWvjreHpWrk,3178
|
|
13
|
+
tplinkrouterc6u/client/c5400x.py,sha256=wvqeCnsoM7dYr3q7NHGAeXJHRpEYYXZ0rvrU9j6qLu4,4330
|
|
14
|
+
tplinkrouterc6u/client/c6v4.py,sha256=-IF7SqTZx56lRAVmiyxK9VKkrmD7srQSJWFvn2Z0DII,1489
|
|
15
|
+
tplinkrouterc6u/client/deco.py,sha256=0NW65b39lXKAnVimLHoe0f3Std6i1V21fZMaorKqsW0,8273
|
|
16
|
+
tplinkrouterc6u/client/ex.py,sha256=jkxCgqbjp-SfjlzgKeNj4WhV3v9gEOzKgrgfVgy9SB4,11604
|
|
17
|
+
tplinkrouterc6u/client/mr.py,sha256=nnCYbucl7iFfcePua3fT1YJPDzYlxTTmKddKSC-wUqM,22759
|
|
18
|
+
tplinkrouterc6u/common/__init__.py,sha256=pCTvVZ9CAwgb7MxRnLx0y1rI0sTKSwT24FfxWfQXeTM,33
|
|
19
|
+
tplinkrouterc6u/common/dataclass.py,sha256=DFWANchEhFNHUlduEGPVzcFDaqr3dbFq9Ah8h8pGa_U,6938
|
|
20
|
+
tplinkrouterc6u/common/encryption.py,sha256=4HelTxzN6esMfDZRBt3m8bwB9Nj_biKijnCnrGWPWKg,6228
|
|
21
|
+
tplinkrouterc6u/common/exception.py,sha256=_0G8ZvW5__CsGifHrsZeULdl8c6EUD071sDCQsQgrHY,140
|
|
22
|
+
tplinkrouterc6u/common/helper.py,sha256=phcPUdpY7lJVWF8Ih4KHNdsdem2ed6qFSDXuEAtAgug,334
|
|
23
|
+
tplinkrouterc6u/common/package_enum.py,sha256=bqmnu4gQMEntMCgsya2R7dRcrSJIDPWMj8vNN6JxeME,1382
|
|
24
|
+
tplinkrouterc6u-5.1.0.dist-info/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
|
|
25
|
+
tplinkrouterc6u-5.1.0.dist-info/METADATA,sha256=VHCZsN-I-kBWLIG-IUZmbK7XlO_tTaAjnafRLiqr1Rw,13596
|
|
26
|
+
tplinkrouterc6u-5.1.0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
27
|
+
tplinkrouterc6u-5.1.0.dist-info/top_level.txt,sha256=1iSCCIueqgEkrTxtQ-jiHe99jAB10zqrVdBcwvNfe_M,21
|
|
28
|
+
tplinkrouterc6u-5.1.0.dist-info/RECORD,,
|