tplinkrouterc6u 4.2.1__py3-none-any.whl → 4.2.3__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.py +21 -8
- test/test_client_deco.py +2 -2
- tplinkrouterc6u/__init__.py +1 -1
- tplinkrouterc6u/client.py +7 -7
- tplinkrouterc6u/dataclass.py +1 -1
- tplinkrouterc6u/helper.py +8 -0
- {tplinkrouterc6u-4.2.1.dist-info → tplinkrouterc6u-4.2.3.dist-info}/METADATA +6 -5
- tplinkrouterc6u-4.2.3.dist-info/RECORD +17 -0
- {tplinkrouterc6u-4.2.1.dist-info → tplinkrouterc6u-4.2.3.dist-info}/WHEEL +1 -1
- tplinkrouterc6u-4.2.1.dist-info/RECORD +0 -16
- /tplinkrouterc6u/{enum.py → package_enum.py} +0 -0
- {tplinkrouterc6u-4.2.1.dist-info → tplinkrouterc6u-4.2.3.dist-info}/LICENSE +0 -0
- {tplinkrouterc6u-4.2.1.dist-info → tplinkrouterc6u-4.2.3.dist-info}/top_level.txt +0 -0
test/test_client.py
CHANGED
|
@@ -53,6 +53,12 @@ class TestTPLinkClient(TestCase):
|
|
|
53
53
|
"macaddr": "06:82:9d:2b:8f:c6",
|
|
54
54
|
"ipaddr": "192.168.1.186",
|
|
55
55
|
"hostname": "UNKNOWN"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"wire_type": "2.4G",
|
|
59
|
+
"macaddr": "06:55:9d:2b:8f:a7",
|
|
60
|
+
"ipaddr": "Unknown",
|
|
61
|
+
"hostname": "Unknown"
|
|
56
62
|
}
|
|
57
63
|
],
|
|
58
64
|
"guest_5g_psk_key": "",
|
|
@@ -225,9 +231,9 @@ class TestTPLinkClient(TestCase):
|
|
|
225
231
|
self.assertEqual(status.wan_ipv4_gateway, '192.168.1.254')
|
|
226
232
|
self.assertIsInstance(status.wan_ipv4_address, IPv4Address)
|
|
227
233
|
self.assertEqual(status.wired_total, 2)
|
|
228
|
-
self.assertEqual(status.wifi_clients_total,
|
|
234
|
+
self.assertEqual(status.wifi_clients_total, 3)
|
|
229
235
|
self.assertEqual(status.guest_clients_total, 0)
|
|
230
|
-
self.assertEqual(status.clients_total,
|
|
236
|
+
self.assertEqual(status.clients_total, 5)
|
|
231
237
|
self.assertEqual(status.iot_clients_total, None)
|
|
232
238
|
self.assertEqual(status.guest_2g_enable, False)
|
|
233
239
|
self.assertEqual(status.guest_5g_enable, False)
|
|
@@ -238,7 +244,7 @@ class TestTPLinkClient(TestCase):
|
|
|
238
244
|
self.assertEqual(status.wan_ipv4_uptime, None)
|
|
239
245
|
self.assertEqual(status.mem_usage, 0.43)
|
|
240
246
|
self.assertEqual(status.cpu_usage, 0.28)
|
|
241
|
-
self.assertEqual(len(status.devices),
|
|
247
|
+
self.assertEqual(len(status.devices), 5)
|
|
242
248
|
self.assertIsInstance(status.devices[0], Device)
|
|
243
249
|
self.assertEqual(status.devices[0].type, Connection.WIRED)
|
|
244
250
|
self.assertEqual(status.devices[0].macaddr, '3D-24-25-24-30-79')
|
|
@@ -265,12 +271,19 @@ class TestTPLinkClient(TestCase):
|
|
|
265
271
|
self.assertEqual(status.devices[2].packets_sent, 450333)
|
|
266
272
|
self.assertEqual(status.devices[2].packets_received, 4867482)
|
|
267
273
|
self.assertIsInstance(status.devices[3], Device)
|
|
268
|
-
self.assertEqual(status.devices[3].type, Connection.
|
|
269
|
-
self.assertEqual(status.devices[3].macaddr, '
|
|
274
|
+
self.assertEqual(status.devices[3].type, Connection.HOST_2G)
|
|
275
|
+
self.assertEqual(status.devices[3].macaddr, '06-55-9D-2B-8F-A7')
|
|
270
276
|
self.assertEqual(status.devices[3].ipaddr, '0.0.0.0')
|
|
271
|
-
self.assertEqual(status.devices[3].hostname, '')
|
|
272
|
-
self.assertEqual(status.devices[3].packets_sent,
|
|
273
|
-
self.assertEqual(status.devices[3].packets_received,
|
|
277
|
+
self.assertEqual(status.devices[3].hostname, 'Unknown')
|
|
278
|
+
self.assertEqual(status.devices[3].packets_sent, None)
|
|
279
|
+
self.assertEqual(status.devices[3].packets_received, None)
|
|
280
|
+
self.assertIsInstance(status.devices[4], Device)
|
|
281
|
+
self.assertEqual(status.devices[4].type, Connection.HOST_5G)
|
|
282
|
+
self.assertEqual(status.devices[4].macaddr, '1F-7A-BD-F7-20-0D')
|
|
283
|
+
self.assertEqual(status.devices[4].ipaddr, '0.0.0.0')
|
|
284
|
+
self.assertEqual(status.devices[4].hostname, '')
|
|
285
|
+
self.assertEqual(status.devices[4].packets_sent, 134815)
|
|
286
|
+
self.assertEqual(status.devices[4].packets_received, 2953078)
|
|
274
287
|
|
|
275
288
|
def test_get_status_ax_55(self) -> None:
|
|
276
289
|
response_status = '''
|
test/test_client_deco.py
CHANGED
|
@@ -71,7 +71,7 @@ class TestTPLinkDecoClient(TestCase):
|
|
|
71
71
|
"online": true, "name": "d2lyZWxlc3M0", "enable_priority": false, "remain_time": 0, "owner_id": "",
|
|
72
72
|
"client_type": "other", "interface": "guest"},
|
|
73
73
|
{"mac": "56:32:c3:de:ce:f0", "up_speed": 3, "down_speed": 1, "wire_type": "wireless", "access_host": "1",
|
|
74
|
-
"connection_type": "band2_4", "space_id": "1", "ip": "
|
|
74
|
+
"connection_type": "band2_4", "space_id": "1", "ip": "UNKNOWN", "client_mesh": true,
|
|
75
75
|
"online": true, "name": "d2lyZWxlc3M1", "enable_priority": false, "remain_time": 0, "owner_id": "",
|
|
76
76
|
"client_type": "other", "interface": "guest"}
|
|
77
77
|
]}, "error_code": 0}
|
|
@@ -150,7 +150,7 @@ class TestTPLinkDecoClient(TestCase):
|
|
|
150
150
|
self.assertIsInstance(status.devices[4], Device)
|
|
151
151
|
self.assertEqual(status.devices[4].type, Connection.GUEST_2G)
|
|
152
152
|
self.assertEqual(status.devices[4].macaddr, '56-32-C3-DE-CE-F0')
|
|
153
|
-
self.assertEqual(status.devices[4].ipaddr, '
|
|
153
|
+
self.assertEqual(status.devices[4].ipaddr, '0.0.0.0')
|
|
154
154
|
self.assertEqual(status.devices[4].hostname, 'wireless5')
|
|
155
155
|
self.assertEqual(status.devices[4].packets_sent, None)
|
|
156
156
|
self.assertEqual(status.devices[4].packets_received, None)
|
tplinkrouterc6u/__init__.py
CHANGED
tplinkrouterc6u/client.py
CHANGED
|
@@ -10,8 +10,9 @@ from datetime import timedelta
|
|
|
10
10
|
from macaddress import EUI48
|
|
11
11
|
from ipaddress import IPv4Address
|
|
12
12
|
from logging import Logger
|
|
13
|
+
from tplinkrouterc6u.helper import get_ip
|
|
13
14
|
from tplinkrouterc6u.encryption import EncryptionWrapper, EncryptionWrapperMR
|
|
14
|
-
from tplinkrouterc6u.
|
|
15
|
+
from tplinkrouterc6u.package_enum import Connection
|
|
15
16
|
from tplinkrouterc6u.dataclass import Firmware, Status, Device, IPv4Reservation, IPv4DHCPLease, IPv4Status
|
|
16
17
|
from tplinkrouterc6u.exception import ClientException, ClientError
|
|
17
18
|
from abc import ABC, abstractmethod
|
|
@@ -355,7 +356,7 @@ class TplinkBaseRouter(AbstractRouter, TplinkRequest):
|
|
|
355
356
|
|
|
356
357
|
def _add_device(conn: Connection, item: dict) -> None:
|
|
357
358
|
devices[item['macaddr']] = Device(conn, EUI48(item['macaddr']),
|
|
358
|
-
|
|
359
|
+
get_ip(item['ipaddr']),
|
|
359
360
|
item['hostname'])
|
|
360
361
|
|
|
361
362
|
for item in data.get('access_devices_wired', []):
|
|
@@ -381,7 +382,7 @@ class TplinkBaseRouter(AbstractRouter, TplinkRequest):
|
|
|
381
382
|
for item in smart_network:
|
|
382
383
|
if item['mac'] not in devices:
|
|
383
384
|
conn = self._map_wire_type(item.get('deviceTag'), not item.get('isGuest'))
|
|
384
|
-
devices[item['mac']] = Device(conn, EUI48(item['mac']),
|
|
385
|
+
devices[item['mac']] = Device(conn, EUI48(item['mac']), get_ip(item['ip']),
|
|
385
386
|
item['deviceName'])
|
|
386
387
|
if conn.is_iot():
|
|
387
388
|
if status.iot_clients_total is None:
|
|
@@ -579,10 +580,9 @@ class TPLinkDecoClient(TplinkEncryption, AbstractRouter):
|
|
|
579
580
|
status.iot_clients_total = 0
|
|
580
581
|
status.iot_clients_total += 1
|
|
581
582
|
|
|
582
|
-
ip = item['ip'] if item.get('ip') else '0.0.0.0'
|
|
583
583
|
device = Device(conn,
|
|
584
584
|
EUI48(item['mac']),
|
|
585
|
-
|
|
585
|
+
get_ip(item.get('ip', '0.0.0.0')),
|
|
586
586
|
b64decode(item['name']).decode())
|
|
587
587
|
device.down_speed = item.get('down_speed')
|
|
588
588
|
device.up_speed = item.get('up_speed')
|
|
@@ -1125,7 +1125,7 @@ class TPLinkMRClient(AbstractRouter):
|
|
|
1125
1125
|
lines = response.split('\n')
|
|
1126
1126
|
for line in lines:
|
|
1127
1127
|
if line.startswith('['):
|
|
1128
|
-
regexp = search('\[\d,\d,\d,\d,\d,\d\](\d)', line)
|
|
1128
|
+
regexp = search(r'\[\d,\d,\d,\d,\d,\d\](\d)', line)
|
|
1129
1129
|
if regexp is not None:
|
|
1130
1130
|
obj = {}
|
|
1131
1131
|
index = regexp.group(1)
|
|
@@ -1315,7 +1315,7 @@ class TPLinkMRClient(AbstractRouter):
|
|
|
1315
1315
|
Return value:
|
|
1316
1316
|
return code (int)
|
|
1317
1317
|
'''
|
|
1318
|
-
result = search('\$\.ret=(.*);', response_text)
|
|
1318
|
+
result = search(r'\$\.ret=(.*);', response_text)
|
|
1319
1319
|
assert result is not None
|
|
1320
1320
|
assert result.group(1).isnumeric()
|
|
1321
1321
|
|
tplinkrouterc6u/dataclass.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.3
|
|
4
4
|
Summary: TP-Link Router API
|
|
5
5
|
Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
|
|
6
6
|
Author: Alex Erohin
|
|
@@ -225,6 +225,7 @@ or you have TP-link C1200 V2 or similar router you need to get web encrypted pas
|
|
|
225
225
|
## <a id="supports">Supported routers</a>
|
|
226
226
|
### Fully tested Hardware Versions
|
|
227
227
|
- Archer A7 V5
|
|
228
|
+
- Archer A9 V6
|
|
228
229
|
- Archer AX10 v1.0
|
|
229
230
|
- Archer AX12 v1.0
|
|
230
231
|
- Archer AX20 v1.0
|
|
@@ -237,6 +238,7 @@ or you have TP-link C1200 V2 or similar router you need to get web encrypted pas
|
|
|
237
238
|
- Archer AX72 V1
|
|
238
239
|
- Archer AX73 V1
|
|
239
240
|
- Archer AX75 V1
|
|
241
|
+
- Archer AX90 V1.20
|
|
240
242
|
- Archer AXE75 V1
|
|
241
243
|
- Archer AXE16000
|
|
242
244
|
- Archer AX3000 V1
|
|
@@ -244,7 +246,7 @@ or you have TP-link C1200 V2 or similar router you need to get web encrypted pas
|
|
|
244
246
|
- Archer AX11000 V1
|
|
245
247
|
- Archer BE800 v1.0
|
|
246
248
|
- Archer BE805 v1.0
|
|
247
|
-
- Archer C1200 v2.0 (You need to use [web encrypted password](#encrypted_pass))
|
|
249
|
+
- Archer C1200 (v1.0, v2.0) (You need to use [web encrypted password](#encrypted_pass))
|
|
248
250
|
- Archer C2300 v1.0 (You need to use [web encrypted password](#encrypted_pass))
|
|
249
251
|
- Archer C6 (v2.0, v3.0)
|
|
250
252
|
- Archer C6U v1.0
|
|
@@ -252,7 +254,7 @@ or you have TP-link C1200 V2 or similar router you need to get web encrypted pas
|
|
|
252
254
|
- Archer C5400X V1
|
|
253
255
|
- Archer GX90 v1.0
|
|
254
256
|
- Archer MR200 (v5, v5.3)
|
|
255
|
-
- Archer MR600 (v1, v3)
|
|
257
|
+
- Archer MR600 (v1, v2, v3)
|
|
256
258
|
- Archer VR2100v v1
|
|
257
259
|
- Archer VR900v
|
|
258
260
|
- Deco M4 2.0
|
|
@@ -270,15 +272,14 @@ or you have TP-link C1200 V2 or similar router you need to get web encrypted pas
|
|
|
270
272
|
- TL-MR100 v2.0
|
|
271
273
|
- TL-MR105
|
|
272
274
|
- TL-MR6400 (v5, v5.3)
|
|
275
|
+
- TL-MR6500v
|
|
273
276
|
- TL-WA3001 v1.0
|
|
274
277
|
|
|
275
278
|
### Not fully tested Hardware Versions
|
|
276
279
|
- AD7200 V2
|
|
277
280
|
- Archer A6 (V2 and V3)
|
|
278
|
-
- Archer A9 V6
|
|
279
281
|
- Archer A10 (V1 and V2)
|
|
280
282
|
- Archer A20 (V1, V3)
|
|
281
|
-
- Archer C7 V4
|
|
282
283
|
- Archer C8 (V3 and V4)
|
|
283
284
|
- Archer C9 (V4 and V5)
|
|
284
285
|
- Archer C59 V2
|
|
@@ -0,0 +1,17 @@
|
|
|
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=OqJ9e6_TcX60Ccqj_UH9AQ3Ty25hfdbtPvtzLnWpMn0,30464
|
|
5
|
+
test/test_client_mr.py,sha256=znDA8PBxHOGKbZHzsyERbEEWjkP0U5KpV8Z-kaRnXIM,23046
|
|
6
|
+
tplinkrouterc6u/__init__.py,sha256=EpcrPHORAk_m76WDHMLea_RzCPjqZYAs_774JZChLGs,410
|
|
7
|
+
tplinkrouterc6u/client.py,sha256=dUV4jbx_r4RP_vjvUePxjaZ5LW1D1hJ9BtISWXlPIqM,51458
|
|
8
|
+
tplinkrouterc6u/dataclass.py,sha256=SuAOqKun_ThaeUEa8F9wi6qu4ucUatYMzebo39Kk10s,6617
|
|
9
|
+
tplinkrouterc6u/encryption.py,sha256=2InKlHLQSWkcI8yP8EIGSG-bGXft_KU-bplGjcoeE-k,5546
|
|
10
|
+
tplinkrouterc6u/exception.py,sha256=PUTPsadxiylQhIRUMfkN1RWXh07cHmdav9Pdgxs3Lmw,90
|
|
11
|
+
tplinkrouterc6u/helper.py,sha256=mbPkS_9GfOYMxEIx-q-xLlupR0-m_MDgCWQgx8xxOA8,172
|
|
12
|
+
tplinkrouterc6u/package_enum.py,sha256=bqmnu4gQMEntMCgsya2R7dRcrSJIDPWMj8vNN6JxeME,1382
|
|
13
|
+
tplinkrouterc6u-4.2.3.dist-info/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
|
|
14
|
+
tplinkrouterc6u-4.2.3.dist-info/METADATA,sha256=v6KaqYCwRYqjwvMouDqkLgbp0_X9nz4y1K-qcMoTh4Y,13058
|
|
15
|
+
tplinkrouterc6u-4.2.3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
16
|
+
tplinkrouterc6u-4.2.3.dist-info/top_level.txt,sha256=1iSCCIueqgEkrTxtQ-jiHe99jAB10zqrVdBcwvNfe_M,21
|
|
17
|
+
tplinkrouterc6u-4.2.3.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
test/__init__.py,sha256=McQmUjeN3AwmwdS6QNfwGXXE77OKoPK852I2BM9XsrU,210
|
|
2
|
-
test/test_client.py,sha256=W9pGExVv5mMNpRedtCSWnBtyXzEbbPqSP9-DlIfvYEw,29994
|
|
3
|
-
test/test_client_c1200.py,sha256=O6NK9uXIEb_vks6lI3g7j6q8TYJ9MSDFYzGA_wOBhOA,4620
|
|
4
|
-
test/test_client_deco.py,sha256=8mo_9KEqVBsrazBHaGUdQTIsSvXcHtCT-l7MBxXSP3o,30478
|
|
5
|
-
test/test_client_mr.py,sha256=znDA8PBxHOGKbZHzsyERbEEWjkP0U5KpV8Z-kaRnXIM,23046
|
|
6
|
-
tplinkrouterc6u/__init__.py,sha256=CECjWGaoM8ABX3-95GUa4Xg9DCKzX2k8IprPg1fvnYw,402
|
|
7
|
-
tplinkrouterc6u/client.py,sha256=5eJG5wSPh623EQGVrL4jCSMnDjZzQiDID8ID_Ung64M,51459
|
|
8
|
-
tplinkrouterc6u/dataclass.py,sha256=VVLeWzH6_HYvjiw31aWisW5w8UTgiojWTgnQB7Tb5eM,6609
|
|
9
|
-
tplinkrouterc6u/encryption.py,sha256=2InKlHLQSWkcI8yP8EIGSG-bGXft_KU-bplGjcoeE-k,5546
|
|
10
|
-
tplinkrouterc6u/enum.py,sha256=bqmnu4gQMEntMCgsya2R7dRcrSJIDPWMj8vNN6JxeME,1382
|
|
11
|
-
tplinkrouterc6u/exception.py,sha256=PUTPsadxiylQhIRUMfkN1RWXh07cHmdav9Pdgxs3Lmw,90
|
|
12
|
-
tplinkrouterc6u-4.2.1.dist-info/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
|
|
13
|
-
tplinkrouterc6u-4.2.1.dist-info/METADATA,sha256=wLzKfTJ16kcr07D36O44WDosOYIv6G6ZziH7ddSP8y4,13028
|
|
14
|
-
tplinkrouterc6u-4.2.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
15
|
-
tplinkrouterc6u-4.2.1.dist-info/top_level.txt,sha256=1iSCCIueqgEkrTxtQ-jiHe99jAB10zqrVdBcwvNfe_M,21
|
|
16
|
-
tplinkrouterc6u-4.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|