tplinkrouterc6u 5.6.0__tar.gz → 5.6.2__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.
Files changed (38) hide show
  1. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/PKG-INFO +21 -27
  2. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/README.md +17 -24
  3. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/setup.py +2 -2
  4. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_c80.py +133 -0
  5. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/c80.py +7 -3
  6. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/deco.py +18 -0
  7. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/mr.py +2 -0
  8. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/xdr.py +2 -0
  9. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u.egg-info/PKG-INFO +21 -27
  10. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u.egg-info/SOURCES.txt +0 -1
  11. tplinkrouterc6u-5.6.0/tplinkrouterc6u/client/c6v4.py +0 -41
  12. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/LICENSE +0 -0
  13. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/setup.cfg +0 -0
  14. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/__init__.py +0 -0
  15. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_c1200.py +0 -0
  16. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_c6u.py +0 -0
  17. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_deco.py +0 -0
  18. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_ex.py +0 -0
  19. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_mr.py +0 -0
  20. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/test/test_client_xdr.py +0 -0
  21. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/__init__.py +0 -0
  22. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/__init__.py +0 -0
  23. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/c1200.py +0 -0
  24. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/c5400x.py +0 -0
  25. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/c6u.py +0 -0
  26. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/ex.py +0 -0
  27. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client/vr.py +0 -0
  28. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/client_abstract.py +0 -0
  29. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/__init__.py +0 -0
  30. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/dataclass.py +0 -0
  31. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/encryption.py +0 -0
  32. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/exception.py +0 -0
  33. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/helper.py +0 -0
  34. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/common/package_enum.py +0 -0
  35. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u/provider.py +0 -0
  36. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u.egg-info/dependency_links.txt +0 -0
  37. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u.egg-info/requires.txt +0 -0
  38. {tplinkrouterc6u-5.6.0 → tplinkrouterc6u-5.6.2}/tplinkrouterc6u.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: tplinkrouterc6u
3
- Version: 5.6.0
4
- Summary: TP-Link Router API
3
+ Version: 5.6.2
4
+ Summary: TP-Link Router API (supports also Mercusys Router)
5
5
  Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
6
6
  Author: Alex Erohin
7
7
  Author-email: alexanderErohin@yandex.ru
@@ -25,12 +25,13 @@ Dynamic: classifier
25
25
  Dynamic: description
26
26
  Dynamic: description-content-type
27
27
  Dynamic: home-page
28
+ Dynamic: license-file
28
29
  Dynamic: requires-dist
29
30
  Dynamic: requires-python
30
31
  Dynamic: summary
31
32
 
32
- # TP-Link Router API
33
- Python package for API access and management for TP-Link Routers. See [Supported routers](#supports)
33
+ # TP-Link Router API (supports also Mercusys Router)
34
+ Python package for API access and management for TP-Link and Mercusys Routers. See [Supported routers](#supports)
34
35
 
35
36
  [![Pypi](https://img.shields.io/pypi/v/tplinkrouterc6u)](https://pypi.org/project/tplinkrouterc6u/)
36
37
  [![Downloads](https://static.pepy.tech/personalized-badge/tplinkrouterc6u?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pypi.org/project/tplinkrouterc6u/)
@@ -284,13 +285,15 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
284
285
  - VPN.PPTP_VPN
285
286
 
286
287
  ## <a id="supports">Supported routers</a>
287
- ### Fully tested Hardware Versions
288
+ - [TP-LINK routers](#tplink)
289
+ - [MERCUSYS routers](#mercusys)
290
+ ### <a id="tplink">TP-LINK routers</a>
288
291
  - Archer A7 V5
292
+ - Archer A8 1.0
289
293
  - Archer A9 V6
290
294
  - Archer AX10 v1.0
291
295
  - Archer AX12 v1.0
292
- - Archer AX20 v1.0
293
- - Archer AX20 v3.0
296
+ - Archer AX20 (v1.0, v3.0)
294
297
  - Archer AX21 (v1.20, v3.0)
295
298
  - Archer AX23 (v1.0, v1.2)
296
299
  - Archer AX50 v1.0
@@ -311,10 +314,12 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
311
314
  - Archer BE3600 1.6
312
315
  - Archer C1200 (v1.0, v2.0)
313
316
  - Archer C2300 (v1.0, v2.0)
314
- - Archer C6 (v2.0, v3.0)
317
+ - Archer C6 (v2.0, v3.0, 4.0)
315
318
  - Archer C6U v1.0
316
319
  - Archer C7 (v4.0, v5.0)
317
- - Archer C80 2.20
320
+ - Archer C24 (1.0, 2.0)
321
+ - Archer C60 v2.0
322
+ - Archer C80 (1.0, 2.20)
318
323
  - Archer C5400X V1
319
324
  - Archer GX90 v1.0
320
325
  - Archer MR200 (v5, v5.3, v6.0)
@@ -345,27 +350,16 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
345
350
  - TL-MR105
346
351
  - TL-MR6400 (v5, v5.3)
347
352
  - TL-MR6500v
353
+ - TL-WA1201 3.0
348
354
  - TL-WA3001 v1.0
349
355
  - TL-XDR3010 V2
350
356
  - XC220-G3v v2.30
357
+ ### <a id="mercusys">MERCUSYS routers</a>
358
+ - MR47BE v1.0
359
+ - MR50G 1.0
360
+ - H60XR 1.0
351
361
 
352
- ### Not fully tested Hardware Versions
353
- - AD7200 V2
354
- - Archer A6 (V2 and V3)
355
- - Archer A10 (V1 and V2)
356
- - Archer A20 (V1, V3)
357
- - Archer C8 (V3 and V4)
358
- - Archer C9 (V4 and V5)
359
- - Archer C59 V2
360
- - Archer C90 V6
361
- - Archer C900 V1
362
- - Archer C1200 V3
363
- - Archer C1900 V2
364
- - Archer C4000 (V2 and V3)
365
- - Archer C5400 V2
366
- - TL-WR1043N V5
367
-
368
- Please let me know if you have tested integration with one of this or other model. Open an issue with info about router's model, hardware and firmware versions.
362
+ Please let me know if you have tested integration with any other model. Open an issue with info about router's model, hardware and firmware versions.
369
363
 
370
364
  ## <a id="add_support">Adding Support For More Models</a>
371
365
  Guidelines [CONTRIBUTING.md](https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/master/CONTRIBUTING.md)
@@ -1,5 +1,5 @@
1
- # TP-Link Router API
2
- Python package for API access and management for TP-Link Routers. See [Supported routers](#supports)
1
+ # TP-Link Router API (supports also Mercusys Router)
2
+ Python package for API access and management for TP-Link and Mercusys Routers. See [Supported routers](#supports)
3
3
 
4
4
  [![Pypi](https://img.shields.io/pypi/v/tplinkrouterc6u)](https://pypi.org/project/tplinkrouterc6u/)
5
5
  [![Downloads](https://static.pepy.tech/personalized-badge/tplinkrouterc6u?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pypi.org/project/tplinkrouterc6u/)
@@ -253,13 +253,15 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
253
253
  - VPN.PPTP_VPN
254
254
 
255
255
  ## <a id="supports">Supported routers</a>
256
- ### Fully tested Hardware Versions
256
+ - [TP-LINK routers](#tplink)
257
+ - [MERCUSYS routers](#mercusys)
258
+ ### <a id="tplink">TP-LINK routers</a>
257
259
  - Archer A7 V5
260
+ - Archer A8 1.0
258
261
  - Archer A9 V6
259
262
  - Archer AX10 v1.0
260
263
  - Archer AX12 v1.0
261
- - Archer AX20 v1.0
262
- - Archer AX20 v3.0
264
+ - Archer AX20 (v1.0, v3.0)
263
265
  - Archer AX21 (v1.20, v3.0)
264
266
  - Archer AX23 (v1.0, v1.2)
265
267
  - Archer AX50 v1.0
@@ -280,10 +282,12 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
280
282
  - Archer BE3600 1.6
281
283
  - Archer C1200 (v1.0, v2.0)
282
284
  - Archer C2300 (v1.0, v2.0)
283
- - Archer C6 (v2.0, v3.0)
285
+ - Archer C6 (v2.0, v3.0, 4.0)
284
286
  - Archer C6U v1.0
285
287
  - Archer C7 (v4.0, v5.0)
286
- - Archer C80 2.20
288
+ - Archer C24 (1.0, 2.0)
289
+ - Archer C60 v2.0
290
+ - Archer C80 (1.0, 2.20)
287
291
  - Archer C5400X V1
288
292
  - Archer GX90 v1.0
289
293
  - Archer MR200 (v5, v5.3, v6.0)
@@ -314,27 +318,16 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
314
318
  - TL-MR105
315
319
  - TL-MR6400 (v5, v5.3)
316
320
  - TL-MR6500v
321
+ - TL-WA1201 3.0
317
322
  - TL-WA3001 v1.0
318
323
  - TL-XDR3010 V2
319
324
  - XC220-G3v v2.30
325
+ ### <a id="mercusys">MERCUSYS routers</a>
326
+ - MR47BE v1.0
327
+ - MR50G 1.0
328
+ - H60XR 1.0
320
329
 
321
- ### Not fully tested Hardware Versions
322
- - AD7200 V2
323
- - Archer A6 (V2 and V3)
324
- - Archer A10 (V1 and V2)
325
- - Archer A20 (V1, V3)
326
- - Archer C8 (V3 and V4)
327
- - Archer C9 (V4 and V5)
328
- - Archer C59 V2
329
- - Archer C90 V6
330
- - Archer C900 V1
331
- - Archer C1200 V3
332
- - Archer C1900 V2
333
- - Archer C4000 (V2 and V3)
334
- - Archer C5400 V2
335
- - TL-WR1043N V5
336
-
337
- Please let me know if you have tested integration with one of this or other model. Open an issue with info about router's model, hardware and firmware versions.
330
+ Please let me know if you have tested integration with any other model. Open an issue with info about router's model, hardware and firmware versions.
338
331
 
339
332
  ## <a id="add_support">Adding Support For More Models</a>
340
333
  Guidelines [CONTRIBUTING.md](https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/master/CONTRIBUTING.md)
@@ -5,10 +5,10 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="tplinkrouterc6u",
8
- version="5.6.0",
8
+ version="5.6.2",
9
9
  author="Alex Erohin",
10
10
  author_email="alexanderErohin@yandex.ru",
11
- description="TP-Link Router API",
11
+ description="TP-Link Router API (supports also Mercusys Router)",
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
14
14
  url="https://github.com/AlexandrErohin/TP-Link-Archer-C6U",
@@ -162,6 +162,106 @@ STATUS_RESPONSE_TEXT = ('00000\r\nid 1|1,0,0\r\nauthKey aaa3eKKee\r\nreserved\r\
162
162
  '\r\nuMaxDownloadSpeed -1\r\nbwCtrlEnable 0\r\nenableBackup 0\r\nbTr069APEnable 0'
163
163
  '\r\nbTr069SSIDEnable 0')
164
164
 
165
+ STATUS_RESPONSE_IOT = ('00000\r\nid 1|1,0,0\r\nauthKey aaa3eKKee\r\nreserved\r\nsetWzd 8\r\nmode 1\r\n'
166
+ 'logLevel 3\r\nfastpath 1\r\nmac 0 00-00-00-00-00-00\r\nmac 1 00-00-00-00-00-01'
167
+ '\r\nwanMacType 0\r\nmodelMergeCursor 8\r\nid 4|1,0,0\r\nip 192.168.0.1\r\n'
168
+ 'mask 255.255.255.0\r\nmode 0\r\nsmartIp 1\r\ngateway 192.168.0.1\r\nid 23|1,0,0'
169
+ '\r\nip 100.100.100.100\r\nmask 255.255.252.0\r\ngateway 100.100.105.1\r\n'
170
+ 'dns 0 100.100.0.1\r\ndns 1 100.100.0.1\r\nstatus 1\r\ncode 0\r\nupTime 30814980'
171
+ '\r\ninPkts 3014881\r\ninOctets 1502000045\r\noutPkts 8216676\r\noutOctets 2500478193'
172
+ '\r\ninRates 337\r\noutRates 714\r\ndualMode 0\r\ndualIp 0.0.0.0\r\ndualMask 0.0.0.0'
173
+ '\r\ndualGateway 0.0.0.0\r\ndualDns 0 0.0.0.0\r\ndualDns 1 0.0.0.0\r\ndualCode 0'
174
+ '\r\ndualStatus 0\r\ninternetDnsDetect 1\r\nid 13|1,0,0\r\nip 0 192.168.0.1\r\n'
175
+ 'ip 1 192.168.0.2\r\nip 2 192.168.0.3\r\nip 3 192.168.0.4\r\nip 4 192.168.0.5'
176
+ '\r\nip 5 192.168.0.6\r\nmac 0 00-00-00-00-00-02\r\nmac 1 00-00-00-00-00-03'
177
+ '\r\nmac 2 00-00-00-00-00-04\r\nmac 3 00-00-00-00-00-05\r\nmac 4 00-00-00-00-00-06'
178
+ '\r\nmac 5 00-00-00-00-00-07\r\nbindEntry 0 0\r\nbindEntry 1 0\r\nbindEntry 2 0'
179
+ '\r\nbindEntry 3 0\r\nbindEntry 4 0\r\nbindEntry 5 0\r\nstaMgtEntry 0 0\r\n'
180
+ 'staMgtEntry 1 0\r\nstaMgtEntry 2 0\r\nstaMgtEntry 3 0\r\nstaMgtEntry 4 1'
181
+ '\r\nstaMgtEntry 5 0\r\ntype 0 3\r\ntype 1 1\r\ntype 2 2\r\ntype 3 1\r\ntype 4 13'
182
+ '\r\ntype 5 0\r\nonline 0 0\r\nonline 1 0\r\nonline 2 1\r\nonline 3 1\r\nonline 4 1'
183
+ '\r\nonline 5 1\r\nblocked 0 0\r\nblocked 1 0\r\nblocked 2 0\r\nblocked 3 0\r\n'
184
+ 'blocked 4 0\r\nblocked 5 0\r\nqosPrior 0 0\r\nqosPrior 1 0\r\nqosPrior 2 0\r\n'
185
+ 'qosPrior 3 0\r\nqosPrior 4 0\r\nqosPrior 5 0\r\nup 0 0\r\nup 1 0\r\nup 2 30\r\n'
186
+ 'up 3 800\r\nup 4 1824\r\nup 5 600\r\ndown 0 0\r\ndown 1 0\r\ndown 2 200\r\n'
187
+ 'down 3 400\r\ndown 4 800\r\ndown 5 50\r\nupLimit 0 204800\r\nupLimit 1 204800\r\n'
188
+ 'upLimit 2 204800\r\nupLimit 3 204800\r\nupLimit 4 204800\r\nupLimit 5 204800\r\n'
189
+ 'downLimit 0 1048576\r\ndownLimit 1 1048576\r\ndownLimit 2 1048576\r\n'
190
+ 'downLimit 3 1048576\r\ndownLimit 4 1048576\r\ndownLimit 5 1048576\r\nname 0 Laptop'
191
+ '\r\nname 1 iPhone\r\nname 2 Laptop2\r\nname 3 iPhone2\r\nname 4 IoT_thing\r\n'
192
+ 'name 5 PC\r\nuBandwidth 0 0\r\nuBandwidth 1 0\r\nuBandwidth 2 0\r\nuBandwidth 3 0'
193
+ '\r\nuBandwidth 4 0\r\nuBandwidth 5 0\r\nuStandard 0 0\r\nuStandard 1 0\r\n'
194
+ 'uStandard 2 0\r\nuStandard 3 2\r\nuStandard 4 2\r\nuStandard 5 0\r\ndevType 0 0'
195
+ '\r\ndevType 1 0\r\ndevType 2 0\r\ndevType 3 0\r\ndevType 4 0\r\ndevType 5 0\r\n'
196
+ 'priTime 0 0\r\npriTime 1 0\r\npriTime 2 0\r\npriTime 3 0\r\npriTime 4 0\r\n'
197
+ 'priTime 5 0\r\nleaseTime 0 0\r\nleaseTime 1 0\r\nleaseTime 2 0\r\nleaseTime 3 0'
198
+ '\r\nleaseTime 4 0\r\nleaseTime 5 0\r\ntotalVal 0 450\r\ntotalVal 1 5\r\n'
199
+ 'totalVal 2 13\r\ntotalVal 3 956\r\ntotalVal 4 13\r\ntotalVal 5 53\r\ntotalUnit 0 2'
200
+ '\r\ntotalUnit 1 2\r\ntotalUnit 2 2\r\ntotalUnit 3 2\r\ntotalUnit 4 2\r\n'
201
+ 'totalUnit 5 2\r\ndhcpsEntry 0 0\r\ndhcpsEntry 1 0\r\ndhcpsEntry 2 0\r\n'
202
+ 'dhcpsEntry 3 0\r\ndhcpsEntry 4 0\r\ndhcpsEntry 5 0\r\nduration 0 0\r\n'
203
+ 'duration 1 0\r\nduration 2 0\r\nduration 3 73\r\nduration 4 5388\r\n'
204
+ 'duration 5 8559\r\ntxRate 0 0\r\ntxRate 1 0\r\ntxRate 2 0\r\ntxRate 3 156\r\n'
205
+ 'txRate 4 130\r\ntxRate 5 0\r\nrxRate 0 0\r\nrxRate 1 0\r\nrxRate 2 0\r\n'
206
+ 'rxRate 3 130\r\nrxRate 4 173\r\nrxRate 5 0\r\naveRssi 0 0\r\naveRssi 1 0\r\n'
207
+ 'aveRssi 2 0\r\naveRssi 3 33\r\naveRssi 4 46\r\naveRssi 5 0\r\nslEnable 0 0\r\n'
208
+ 'slEnable 1 0\r\nslEnable 2 0\r\nslEnable 3 0\r\nslEnable 4 0\r\nslEnable 5 0'
209
+ '\r\npriScheStatus 0 0\r\npriScheStatus 1 0\r\npriScheStatus 2 0\r\n'
210
+ 'priScheStatus 3 0\r\npriScheStatus 4 0\r\npriScheStatus 5 0\r\nstart 0 0\r\n'
211
+ 'start 1 0\r\nstart 2 0\r\nstart 3 0\r\nstart 4 0\r\nstart 5 0\r\nend 0 0\r\n'
212
+ 'end 1 0\r\nend 2 0\r\nend 3 0\r\nend 4 0\r\nend 5 0\r\nday 0 0\r\nday 1 0\r\n'
213
+ 'day 2 0\r\nday 3 0\r\nday 4 0\r\nday 5 0\r\nstartMin 0 0\r\nstartMin 1 0\r\n'
214
+ 'startMin 2 0\r\nstartMin 3 0\r\nstartMin 4 0\r\nstartMin 5 0\r\nendMin 0 0\r\n'
215
+ 'endMin 1 0\r\nendMin 2 0\r\nendMin 3 0\r\nendMin 4 0\r\nendMin 5 0\r\nrate 0 0'
216
+ '\r\nrate 1 0\r\nrate 2 0\r\nrate 3 156\r\nrate 4 173\r\nrate 5 0\r\ntxPkt 0 0'
217
+ '\r\ntxPkt 1 0\r\ntxPkt 2 0\r\ntxPkt 3 42602\r\ntxPkt 4 119683\r\ntxPkt 5 0'
218
+ '\r\nrxPkt 0 0\r\nrxPkt 1 0\r\nrxPkt 2 0\r\nrxPkt 3 6343\r\nrxPkt 4 275076\r\n'
219
+ 'rxPkt 5 0\r\nid 33|1,1,0\r\nuUnit 0\r\ncSsidPrefix\r\nuRadiusIp 0.0.0.0\r\n'
220
+ 'uRadiusGKUpdateIntvl 0\r\nuPskGKUpdateIntvl 0\r\nuKeyLength 0 0\r\nuKeyLength 1 0'
221
+ '\r\nuKeyLength 2 0\r\nuKeyLength 3 0\r\ncKeyVal 0\r\ncKeyVal 1\r\ncKeyVal 2\r\n'
222
+ 'cKeyVal 3\r\nuRadiusPort 1812\r\nuKeyType 0\r\nuDefaultKey 1\r\nbEnable 1\r\n'
223
+ 'bBcastSsid 1\r\ncSsid TP-Link\r\nbSecurityEnable 1\r\nuAuthType 3\r\nuWEPSecOpt 3'
224
+ '\r\nuRadiusSecOpt 3\r\nuPSKSecOpt 2\r\nuRadiusEncryptType 1\r\nuPSKEncryptType 3'
225
+ '\r\ncRadiusSecret\r\ncPskSecret admin\r\nbSecCheck 0\r\nbEnabled 1\r\n'
226
+ 'cUsrPIN 11100111\r\nbConfigured 1\r\nbIsLocked 0\r\nbEnRtPIN 1\r\n'
227
+ 'bWifiBtnRecEnable 1\r\nuVid 0\r\nbMumimo 0\r\nbMwdsEnable 0\r\nbLanAccess 1'
228
+ '\r\nSecurityType 2\r\nbApIsolated 0\r\neffectiveTime 0\r\nuMaxUploadSpeed -1'
229
+ '\r\nuMaxDownloadSpeed -1\r\nbwCtrlEnable 0\r\nenableBackup 1\r\nbTr069APEnable 0'
230
+ '\r\nbTr069SSIDEnable 0\r\nid 33|2,1,0\r\nuUnit 0\r\ncSsidPrefix\r\nuRadiusIp 0.0.0.0'
231
+ '\r\nuRadiusGKUpdateIntvl 0\r\nuPskGKUpdateIntvl 0\r\nuKeyLength 0 0\r\nuKeyLength 1 0'
232
+ '\r\nuKeyLength 2 0\r\nuKeyLength 3 0\r\ncKeyVal 0\r\ncKeyVal 1\r\ncKeyVal 2\r\n'
233
+ 'cKeyVal 3\r\nuRadiusPort 1812\r\nuKeyType 0\r\nuDefaultKey 1\r\nbEnable 1\r\n'
234
+ 'bBcastSsid 1\r\ncSsid TP-Link\r\nbSecurityEnable 1\r\nuAuthType 3\r\nuWEPSecOpt 3'
235
+ '\r\nuRadiusSecOpt 3\r\nuPSKSecOpt 2\r\nuRadiusEncryptType 1\r\nuPSKEncryptType 3'
236
+ '\r\ncRadiusSecret\r\ncPskSecret admin\r\nbSecCheck 0\r\nbEnabled 1\r\n'
237
+ 'cUsrPIN 11100111\r\nbConfigured 1\r\nbIsLocked 0\r\nbEnRtPIN 1\r\nbWifiBtnRecEnable 1'
238
+ '\r\nuVid 0\r\nbMumimo 0\r\nbMwdsEnable 0\r\nbLanAccess 1\r\nSecurityType 2\r\n'
239
+ 'bApIsolated 0\r\neffectiveTime 0\r\nuMaxUploadSpeed -1\r\nuMaxDownloadSpeed -1\r\n'
240
+ 'bwCtrlEnable 0\r\nenableBackup 1\r\nbTr069APEnable 0\r\nbTr069SSIDEnable 0\r\n'
241
+ 'id 33|1,2,0\r\nuUnit 1\r\ncSsidPrefix Guest\r\nuRadiusIp 0.0.0.0\r\n'
242
+ 'uRadiusGKUpdateIntvl 0\r\nuPskGKUpdateIntvl 0\r\nuKeyLength 0 0\r\nuKeyLength 1 0'
243
+ '\r\nuKeyLength 2 0\r\nuKeyLength 3 0\r\ncKeyVal 0\r\ncKeyVal 1\r\ncKeyVal 2\r\n'
244
+ 'cKeyVal 3\r\nuRadiusPort 1812\r\nuKeyType 0\r\nuDefaultKey 1\r\nbEnable 0\r\n'
245
+ 'bBcastSsid 1\r\ncSsid TP-Link_Guest\r\nbSecurityEnable 0\r\nuAuthType 3\r\n'
246
+ 'uWEPSecOpt 3\r\nuRadiusSecOpt 3\r\nuPSKSecOpt 3\r\nuRadiusEncryptType 1\r\n'
247
+ 'uPSKEncryptType 3\r\ncRadiusSecret\r\ncPskSecret\r\nbSecCheck 0\r\nbEnabled 1'
248
+ '\r\ncUsrPIN 11100111\r\nbConfigured 0\r\nbIsLocked 0\r\nbEnRtPIN 0\r\n'
249
+ 'bWifiBtnRecEnable 1\r\nuVid 0\r\nbMumimo 0\r\nbMwdsEnable 0\r\nbLanAccess 0'
250
+ '\r\nSecurityType 1\r\nbApIsolated 1\r\neffectiveTime 0\r\nuMaxUploadSpeed -1'
251
+ '\r\nuMaxDownloadSpeed -1\r\nbwCtrlEnable 0\r\nenableBackup 0\r\nbTr069APEnable 0'
252
+ '\r\nbTr069SSIDEnable 0\r\nid 33|2,2,0\r\nuUnit 1\r\ncSsidPrefix Guest\r\n'
253
+ 'uRadiusIp 0.0.0.0\r\nuRadiusGKUpdateIntvl 0\r\nuPskGKUpdateIntvl 0\r\n'
254
+ 'uKeyLength 0 0\r\nuKeyLength 1 0\r\nuKeyLength 2 0\r\nuKeyLength 3 0\r\n'
255
+ 'cKeyVal 0\r\ncKeyVal 1\r\ncKeyVal 2\r\ncKeyVal 3\r\nuRadiusPort 1812\r\n'
256
+ 'uKeyType 0\r\nuDefaultKey 1\r\nbEnable 0\r\nbBcastSsid 1\r\ncSsid TP-Link_Guest_5G'
257
+ '\r\nbSecurityEnable 0\r\nuAuthType 3\r\nuWEPSecOpt 3\r\nuRadiusSecOpt 3\r\n'
258
+ 'uPSKSecOpt 3\r\nuRadiusEncryptType 1\r\nuPSKEncryptType 3\r\ncRadiusSecret\r\n'
259
+ 'cPskSecret\r\nbSecCheck 0\r\nbEnabled 1\r\ncUsrPIN 11100111\r\nbConfigured 0\r\n'
260
+ 'bIsLocked 0\r\nbEnRtPIN 0\r\nbWifiBtnRecEnable 1\r\nuVid 0\r\nbMumimo 0\r\n'
261
+ 'bMwdsEnable 0\r\nbLanAccess 0\r\nSecurityType 1\r\nbApIsolated 1\r\neffectiveTime 0'
262
+ '\r\nuMaxUploadSpeed -1\r\nuMaxDownloadSpeed -1\r\nbwCtrlEnable 0\r\nenableBackup 0'
263
+ '\r\nbTr069APEnable 0\r\nbTr069SSIDEnable 0')
264
+
165
265
 
166
266
  class ResponseMock():
167
267
  def __init__(self, text, status_code=0):
@@ -430,6 +530,39 @@ class TestTPLinkClient(TestCase):
430
530
  self.assertEqual(device.up_speed, 600)
431
531
  self.assertEqual(device.down_speed, 50)
432
532
 
533
+ def test_get_status_without_iot(self) -> None:
534
+ client = TplinkC80RouterTest('', '')
535
+ client.authorize()
536
+
537
+ client.set_encrypted_response(STATUS_RESPONSE_IOT)
538
+ status = client.get_status()
539
+
540
+ self.assertIsInstance(status, Status)
541
+ self.assertEqual(status.wan_macaddr, '00-00-00-00-00-01')
542
+ self.assertIsInstance(status.wan_macaddress, EUI48)
543
+ self.assertEqual(status.lan_macaddr, '00-00-00-00-00-00')
544
+ self.assertIsInstance(status.lan_macaddress, EUI48)
545
+ self.assertEqual(status.wan_ipv4_addr, '100.100.100.100')
546
+ self.assertIsInstance(status.lan_ipv4_address, IPv4Address)
547
+ self.assertEqual(status.lan_ipv4_addr, '192.168.0.1')
548
+ self.assertEqual(status.wan_ipv4_gateway, '100.100.105.1')
549
+ self.assertIsInstance(status.wan_ipv4_address, IPv4Address)
550
+ self.assertEqual(status.wired_total, 1)
551
+ self.assertEqual(status.wifi_clients_total, 1)
552
+ self.assertEqual(status.guest_clients_total, 1)
553
+ self.assertEqual(status.clients_total, 4)
554
+ self.assertEqual(status.iot_clients_total, 1)
555
+ self.assertFalse(status.guest_2g_enable)
556
+ self.assertFalse(status.guest_5g_enable)
557
+ self.assertIsNone(status.iot_2g_enable)
558
+ self.assertIsNone(status.iot_5g_enable)
559
+ self.assertTrue(status.wifi_2g_enable)
560
+ self.assertTrue(status.wifi_5g_enable)
561
+ self.assertEqual(status.wan_ipv4_uptime, 308149)
562
+ self.assertEqual(status.mem_usage, None)
563
+ self.assertEqual(status.cpu_usage, None)
564
+ self.assertEqual(len(status.devices), 6)
565
+
433
566
  def test_get_ipv4(self) -> None:
434
567
  client = TplinkC80RouterTest('', '')
435
568
  client.authorize()
@@ -77,6 +77,8 @@ class TplinkC80Router(AbstractRouter):
77
77
  verify_ssl: bool = True, timeout: int = 30) -> None:
78
78
  super().__init__(host, password, username, logger, verify_ssl, timeout)
79
79
  self._session = Session()
80
+ if self._verify_ssl is False:
81
+ self._session.verify = False
80
82
  self._encryption = EncryptionState()
81
83
 
82
84
  def supports(self) -> bool:
@@ -161,8 +163,10 @@ class TplinkC80Router(AbstractRouter):
161
163
  'uptime': extract_value(data_blocks[wan_ip_request], "upTime ")
162
164
  }
163
165
 
164
- wifi_status = {key: extract_value(data_blocks[request], "bEnable ") == '1'
165
- for key, request in RouterConstants.CONNECTION_REQUESTS_MAP.items()}
166
+ wifi_status = {}
167
+ for key, request in RouterConstants.CONNECTION_REQUESTS_MAP.items():
168
+ value = data_blocks.get(request)
169
+ wifi_status[key] = extract_value(data_blocks.get(request), "bEnable ") == '1' if value else None
166
170
 
167
171
  device_data_response = data_blocks[device_data_request]
168
172
 
@@ -396,7 +400,7 @@ class TplinkC80Router(AbstractRouter):
396
400
  if use_token:
397
401
  url += f"&id={self._encryption.token}"
398
402
  try:
399
- response = self._session.post(url, data=data, timeout=self.timeout)
403
+ response = self._session.post(url, data=data, timeout=self.timeout, verify=self._verify_ssl)
400
404
  # Raises exception for 4XX/5XX status codes for all requests except 1st in authorize
401
405
  if not (code == 2 and asyn == 1 and use_token is False and data is None):
402
406
  response.raise_for_status()
@@ -1,5 +1,7 @@
1
1
  from base64 import b64decode
2
2
  from json import dumps
3
+ from requests.exceptions import ConnectTimeout
4
+ from collections.abc import Callable
3
5
  from macaddress import EUI48
4
6
  from ipaddress import IPv4Address
5
7
  from logging import Logger
@@ -149,6 +151,22 @@ class TPLinkDecoClient(TplinkEncryption, AbstractRouter):
149
151
 
150
152
  return ipv4_status
151
153
 
154
+ def authorize(self) -> None:
155
+ self._retry_request(super().authorize)
156
+
157
+ def request(self, path: str, data: str, ignore_response: bool = False, ignore_errors: bool = False) -> dict | None:
158
+ return self._retry_request(super().request, path, data, ignore_response, ignore_errors)
159
+
160
+ def _retry_request(self, callback: Callable, *args):
161
+ retries = 0
162
+ while True:
163
+ try:
164
+ return callback(*args)
165
+ except ConnectTimeout as err:
166
+ if retries > 2:
167
+ raise err
168
+ retries += 1
169
+
152
170
  def _map_wire_type(self, data: dict) -> Connection:
153
171
  if data.get('wire_type') == 'wired':
154
172
  return Connection.WIRED
@@ -77,6 +77,8 @@ class TPLinkMRClientBase(AbstractRouter):
77
77
  super().__init__(host, password, username, logger, verify_ssl, timeout)
78
78
 
79
79
  self.req = Session()
80
+ if self._verify_ssl is False:
81
+ self.req.verify = False
80
82
  self._token = None
81
83
  self._hash = md5(f"{self.username}{self.password}".encode()).hexdigest()
82
84
  self._nn = None
@@ -22,6 +22,8 @@ class TPLinkXDRClient(AbstractRouter):
22
22
  verify_ssl: bool = True, timeout: int = 30) -> None:
23
23
  super().__init__(host, password, username, logger, verify_ssl, timeout)
24
24
  self._session = Session()
25
+ if self._verify_ssl is False:
26
+ self._session.verify = False
25
27
 
26
28
  def supports(self) -> bool:
27
29
  response = self._session.get(self.host, timeout=self.timeout, verify=self._verify_ssl)
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: tplinkrouterc6u
3
- Version: 5.6.0
4
- Summary: TP-Link Router API
3
+ Version: 5.6.2
4
+ Summary: TP-Link Router API (supports also Mercusys Router)
5
5
  Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
6
6
  Author: Alex Erohin
7
7
  Author-email: alexanderErohin@yandex.ru
@@ -25,12 +25,13 @@ Dynamic: classifier
25
25
  Dynamic: description
26
26
  Dynamic: description-content-type
27
27
  Dynamic: home-page
28
+ Dynamic: license-file
28
29
  Dynamic: requires-dist
29
30
  Dynamic: requires-python
30
31
  Dynamic: summary
31
32
 
32
- # TP-Link Router API
33
- Python package for API access and management for TP-Link Routers. See [Supported routers](#supports)
33
+ # TP-Link Router API (supports also Mercusys Router)
34
+ Python package for API access and management for TP-Link and Mercusys Routers. See [Supported routers](#supports)
34
35
 
35
36
  [![Pypi](https://img.shields.io/pypi/v/tplinkrouterc6u)](https://pypi.org/project/tplinkrouterc6u/)
36
37
  [![Downloads](https://static.pepy.tech/personalized-badge/tplinkrouterc6u?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pypi.org/project/tplinkrouterc6u/)
@@ -284,13 +285,15 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
284
285
  - VPN.PPTP_VPN
285
286
 
286
287
  ## <a id="supports">Supported routers</a>
287
- ### Fully tested Hardware Versions
288
+ - [TP-LINK routers](#tplink)
289
+ - [MERCUSYS routers](#mercusys)
290
+ ### <a id="tplink">TP-LINK routers</a>
288
291
  - Archer A7 V5
292
+ - Archer A8 1.0
289
293
  - Archer A9 V6
290
294
  - Archer AX10 v1.0
291
295
  - Archer AX12 v1.0
292
- - Archer AX20 v1.0
293
- - Archer AX20 v3.0
296
+ - Archer AX20 (v1.0, v3.0)
294
297
  - Archer AX21 (v1.20, v3.0)
295
298
  - Archer AX23 (v1.0, v1.2)
296
299
  - Archer AX50 v1.0
@@ -311,10 +314,12 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
311
314
  - Archer BE3600 1.6
312
315
  - Archer C1200 (v1.0, v2.0)
313
316
  - Archer C2300 (v1.0, v2.0)
314
- - Archer C6 (v2.0, v3.0)
317
+ - Archer C6 (v2.0, v3.0, 4.0)
315
318
  - Archer C6U v1.0
316
319
  - Archer C7 (v4.0, v5.0)
317
- - Archer C80 2.20
320
+ - Archer C24 (1.0, 2.0)
321
+ - Archer C60 v2.0
322
+ - Archer C80 (1.0, 2.20)
318
323
  - Archer C5400X V1
319
324
  - Archer GX90 v1.0
320
325
  - Archer MR200 (v5, v5.3, v6.0)
@@ -345,27 +350,16 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
345
350
  - TL-MR105
346
351
  - TL-MR6400 (v5, v5.3)
347
352
  - TL-MR6500v
353
+ - TL-WA1201 3.0
348
354
  - TL-WA3001 v1.0
349
355
  - TL-XDR3010 V2
350
356
  - XC220-G3v v2.30
357
+ ### <a id="mercusys">MERCUSYS routers</a>
358
+ - MR47BE v1.0
359
+ - MR50G 1.0
360
+ - H60XR 1.0
351
361
 
352
- ### Not fully tested Hardware Versions
353
- - AD7200 V2
354
- - Archer A6 (V2 and V3)
355
- - Archer A10 (V1 and V2)
356
- - Archer A20 (V1, V3)
357
- - Archer C8 (V3 and V4)
358
- - Archer C9 (V4 and V5)
359
- - Archer C59 V2
360
- - Archer C90 V6
361
- - Archer C900 V1
362
- - Archer C1200 V3
363
- - Archer C1900 V2
364
- - Archer C4000 (V2 and V3)
365
- - Archer C5400 V2
366
- - TL-WR1043N V5
367
-
368
- Please let me know if you have tested integration with one of this or other model. Open an issue with info about router's model, hardware and firmware versions.
362
+ Please let me know if you have tested integration with any other model. Open an issue with info about router's model, hardware and firmware versions.
369
363
 
370
364
  ## <a id="add_support">Adding Support For More Models</a>
371
365
  Guidelines [CONTRIBUTING.md](https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/master/CONTRIBUTING.md)
@@ -21,7 +21,6 @@ tplinkrouterc6u/client/__init__.py
21
21
  tplinkrouterc6u/client/c1200.py
22
22
  tplinkrouterc6u/client/c5400x.py
23
23
  tplinkrouterc6u/client/c6u.py
24
- tplinkrouterc6u/client/c6v4.py
25
24
  tplinkrouterc6u/client/c80.py
26
25
  tplinkrouterc6u/client/deco.py
27
26
  tplinkrouterc6u/client/ex.py
@@ -1,41 +0,0 @@
1
- from requests import post
2
- from tplinkrouterc6u.common.package_enum import Connection
3
- from tplinkrouterc6u.common.dataclass import Firmware, Status, IPv4Status
4
- from tplinkrouterc6u.common.exception import ClientException
5
- from tplinkrouterc6u.client_abstract import AbstractRouter
6
-
7
-
8
- class TplinkC6V4Router(AbstractRouter):
9
- def supports(self) -> bool:
10
- url = '{}/?code=2&asyn=1'.format(self.host)
11
- try:
12
- response = post(url, timeout=self.timeout, verify=self._verify_ssl)
13
- except BaseException:
14
- return False
15
- if response.status_code == 401 and response.text.startswith('00'):
16
- raise ClientException(('Your router is not supported. Please add your router support to '
17
- 'https://github.com/AlexandrErohin/TP-Link-Archer-C6U '
18
- 'by implementing methods for TplinkC6V4Router class'
19
- ))
20
- return False
21
-
22
- def authorize(self) -> None:
23
- raise ClientException('Not Implemented')
24
-
25
- def logout(self) -> None:
26
- raise ClientException('Not Implemented')
27
-
28
- def get_firmware(self) -> Firmware:
29
- raise ClientException('Not Implemented')
30
-
31
- def get_status(self) -> Status:
32
- raise ClientException('Not Implemented')
33
-
34
- def get_ipv4_status(self) -> IPv4Status:
35
- raise ClientException('Not Implemented')
36
-
37
- def reboot(self) -> None:
38
- raise ClientException('Not Implemented')
39
-
40
- def set_wifi(self, wifi: Connection, enable: bool) -> None:
41
- raise ClientException('Not Implemented')
File without changes