tplinkrouterc6u 5.9.4__tar.gz → 5.10.1__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.
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/PKG-INFO +5 -1
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/README.md +4 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/setup.py +1 -1
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_c6u.py +63 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/c6u.py +13 -8
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/dataclass.py +30 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/PKG-INFO +5 -1
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/LICENSE +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/setup.cfg +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/__init__.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_c1200.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_c80.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_deco.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_ex.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_mr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_wdr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/test/test_client_xdr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/__init__.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/__init__.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/c1200.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/c5400x.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/c80.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/deco.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/ex.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/mr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/vr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/wdr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client/xdr.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/client_abstract.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/__init__.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/encryption.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/exception.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/helper.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/common/package_enum.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u/provider.py +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/SOURCES.txt +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/dependency_links.txt +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/requires.txt +0 -0
- {tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.10.1
|
|
4
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
|
|
@@ -258,7 +258,9 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
258
258
|
| enable | is enabled | int |
|
|
259
259
|
| connect_status | connect status | int |
|
|
260
260
|
| network_type | network type | int |
|
|
261
|
+
| network_type_info | Example: 4G LTE | str |
|
|
261
262
|
| sim_status | sim status | int |
|
|
263
|
+
| sim_status_info | Example: SIM locked. | str |
|
|
262
264
|
| total_statistics | total statistics in bytes | int |
|
|
263
265
|
| cur_rx_speed | current download speed in bytes per second | int |
|
|
264
266
|
| cur_tx_speed | current upload speed in bytes per second | int |
|
|
@@ -268,6 +270,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
268
270
|
| rsrq | RSRQ | int |
|
|
269
271
|
| snr | SNR | int |
|
|
270
272
|
| isp_name | ISP name | str |
|
|
273
|
+
| network_types | All possible network types - {0: "No Service", 1: "GSM", 2: "WCDMA", 3: "4G LTE", 4: "TD-SCDMA", 5: "CDMA 1x", 6: "CDMA 1x Ev-Do", 7: "4G+ LTE"} | dict |
|
|
274
|
+
| sim_statuses | All possible sim statuses - {0: "No SIM card detected or SIM card error.", 1: "No SIM card detected.", 2: "SIM card error.", 3: "SIM card prepared.", 4: "SIM locked.", 5: "SIM unlocked. Authentication succeeded.", 6: "PIN locked.", 7: "SIM card is locked permanently.", 8: "suspension of transmission", 9: "Unopened"} | dict |
|
|
271
275
|
|
|
272
276
|
## Enum
|
|
273
277
|
### <a id="connection">Connection</a>
|
|
@@ -226,7 +226,9 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
226
226
|
| enable | is enabled | int |
|
|
227
227
|
| connect_status | connect status | int |
|
|
228
228
|
| network_type | network type | int |
|
|
229
|
+
| network_type_info | Example: 4G LTE | str |
|
|
229
230
|
| sim_status | sim status | int |
|
|
231
|
+
| sim_status_info | Example: SIM locked. | str |
|
|
230
232
|
| total_statistics | total statistics in bytes | int |
|
|
231
233
|
| cur_rx_speed | current download speed in bytes per second | int |
|
|
232
234
|
| cur_tx_speed | current upload speed in bytes per second | int |
|
|
@@ -236,6 +238,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
236
238
|
| rsrq | RSRQ | int |
|
|
237
239
|
| snr | SNR | int |
|
|
238
240
|
| isp_name | ISP name | str |
|
|
241
|
+
| network_types | All possible network types - {0: "No Service", 1: "GSM", 2: "WCDMA", 3: "4G LTE", 4: "TD-SCDMA", 5: "CDMA 1x", 6: "CDMA 1x Ev-Do", 7: "4G+ LTE"} | dict |
|
|
242
|
+
| sim_statuses | All possible sim statuses - {0: "No SIM card detected or SIM card error.", 1: "No SIM card detected.", 2: "SIM card error.", 3: "SIM card prepared.", 4: "SIM locked.", 5: "SIM unlocked. Authentication succeeded.", 6: "PIN locked.", 7: "SIM card is locked permanently.", 8: "suspension of transmission", 9: "Unopened"} | dict |
|
|
239
243
|
|
|
240
244
|
## Enum
|
|
241
245
|
### <a id="connection">Connection</a>
|
|
@@ -769,6 +769,69 @@ class TestTPLinkClient(TestCase):
|
|
|
769
769
|
self.assertEqual(result.wan_ipv4_gateway, '0.0.0.0')
|
|
770
770
|
self.assertEqual(result.lan_macaddr, '06-E6-97-9E-23-F5')
|
|
771
771
|
|
|
772
|
+
def test_get_status_wifi_disabled(self) -> None:
|
|
773
|
+
"""Test that get_status gracefully handles when WiFi is disabled and wireless statistics fail."""
|
|
774
|
+
response_status = '''
|
|
775
|
+
{
|
|
776
|
+
"success": true,
|
|
777
|
+
"data": {
|
|
778
|
+
"lan_macaddr": "06:e6:97:9e:23:f5",
|
|
779
|
+
"wan_macaddr": "06:e6:97:9e:23:f6",
|
|
780
|
+
"wan_ipv4_ipaddr": "192.168.1.1",
|
|
781
|
+
"wan_ipv4_gateway": "192.168.1.254",
|
|
782
|
+
"lan_ipv4_ipaddr": "192.168.0.1",
|
|
783
|
+
"mem_usage": 0.43,
|
|
784
|
+
"cpu_usage": 0.28,
|
|
785
|
+
"conn_type": "1",
|
|
786
|
+
"access_devices_wired": [
|
|
787
|
+
{
|
|
788
|
+
"wire_type": "wired",
|
|
789
|
+
"macaddr": "3d:24:25:24:30:79",
|
|
790
|
+
"ipaddr": "192.168.1.228",
|
|
791
|
+
"hostname": "SERVER"
|
|
792
|
+
}
|
|
793
|
+
],
|
|
794
|
+
"access_devices_wireless_host": [],
|
|
795
|
+
"access_devices_wireless_guest": [],
|
|
796
|
+
"wireless_2g_enable": "off",
|
|
797
|
+
"wireless_5g_enable": "off",
|
|
798
|
+
"guest_2g_enable": "off",
|
|
799
|
+
"guest_5g_enable": "off"
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
'''
|
|
803
|
+
|
|
804
|
+
class TPLinkRouterTest(TplinkRouter):
|
|
805
|
+
def request(self, path: str, data: str,
|
|
806
|
+
ignore_response: bool = False, ignore_errors: bool = False) -> dict | None:
|
|
807
|
+
if path == 'admin/status?form=all&operation=read':
|
|
808
|
+
return loads(response_status)['data']
|
|
809
|
+
elif path == 'admin/wireless?form=statistics':
|
|
810
|
+
# Simulate the error that occurs when WiFi is disabled
|
|
811
|
+
from tplinkrouterc6u.common.exception import ClientError
|
|
812
|
+
raise ClientError('TplinkRouter - An unknown response - Expecting value: line 1 column 1 (char 0)')
|
|
813
|
+
raise ClientException()
|
|
814
|
+
|
|
815
|
+
client = TPLinkRouterTest('', '')
|
|
816
|
+
result = client.get_status()
|
|
817
|
+
|
|
818
|
+
# Should complete successfully without crashing
|
|
819
|
+
self.assertIsInstance(result, Status)
|
|
820
|
+
self.assertEqual(result.wan_macaddr, '06-E6-97-9E-23-F6')
|
|
821
|
+
self.assertEqual(result.lan_macaddr, '06-E6-97-9E-23-F5')
|
|
822
|
+
self.assertEqual(result.wan_ipv4_addr, '192.168.1.1')
|
|
823
|
+
self.assertEqual(result.wan_ipv4_gateway, '192.168.1.254')
|
|
824
|
+
self.assertEqual(result.lan_ipv4_addr, '192.168.0.1')
|
|
825
|
+
self.assertEqual(result.wired_total, 1)
|
|
826
|
+
self.assertEqual(result.wifi_clients_total, 0)
|
|
827
|
+
self.assertEqual(result.guest_clients_total, 0)
|
|
828
|
+
self.assertEqual(result.clients_total, 1)
|
|
829
|
+
self.assertEqual(result.wifi_2g_enable, False)
|
|
830
|
+
self.assertEqual(result.wifi_5g_enable, False)
|
|
831
|
+
# Devices list should only contain wired devices
|
|
832
|
+
self.assertEqual(len(result.devices), 1)
|
|
833
|
+
self.assertEqual(result.devices[0].type, Connection.WIRED)
|
|
834
|
+
|
|
772
835
|
def test_vpn_status(self) -> None:
|
|
773
836
|
response_openvpn_read = """
|
|
774
837
|
{
|
|
@@ -360,14 +360,19 @@ class TplinkBaseRouter(AbstractRouter, TplinkRequest):
|
|
|
360
360
|
devices[item['mac']].up_speed = item.get('uploadSpeed')
|
|
361
361
|
devices[item['mac']].signal = int(item.get('signal')) if item.get('signal') else None
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
363
|
+
try:
|
|
364
|
+
wireless_stats = self.request('admin/wireless?form=statistics', 'operation=load')
|
|
365
|
+
for item in wireless_stats:
|
|
366
|
+
if item['mac'] not in devices:
|
|
367
|
+
status.wifi_clients_total += 1
|
|
368
|
+
type = self._map_wire_type(item.get('type'))
|
|
369
|
+
devices[item['mac']] = Device(type, EUI48(item['mac']), IPv4Address('0.0.0.0'),
|
|
370
|
+
'')
|
|
371
|
+
devices[item['mac']].packets_sent = item.get('txpkts')
|
|
372
|
+
devices[item['mac']].packets_received = item.get('rxpkts')
|
|
373
|
+
except Exception:
|
|
374
|
+
# WiFi might be disabled on the router, skip wireless statistics
|
|
375
|
+
pass
|
|
371
376
|
|
|
372
377
|
status.devices = list(devices.values())
|
|
373
378
|
status.clients_total = status.wired_total + status.wifi_clients_total + status.guest_clients_total
|
|
@@ -274,6 +274,36 @@ class LTEStatus:
|
|
|
274
274
|
rsrq: int | None = None
|
|
275
275
|
snr: int | None = None
|
|
276
276
|
isp_name: str | None = None
|
|
277
|
+
network_types = {
|
|
278
|
+
0: "No Service",
|
|
279
|
+
1: "GSM",
|
|
280
|
+
2: "WCDMA",
|
|
281
|
+
3: "4G LTE",
|
|
282
|
+
4: "TD-SCDMA",
|
|
283
|
+
5: "CDMA 1x",
|
|
284
|
+
6: "CDMA 1x Ev-Do",
|
|
285
|
+
7: "4G+ LTE"
|
|
286
|
+
}
|
|
287
|
+
sim_statuses = {
|
|
288
|
+
0: "No SIM card detected or SIM card error.",
|
|
289
|
+
1: "No SIM card detected.",
|
|
290
|
+
2: "SIM card error.",
|
|
291
|
+
3: "SIM card prepared.",
|
|
292
|
+
4: "SIM locked.",
|
|
293
|
+
5: "SIM unlocked. Authentication succeeded.",
|
|
294
|
+
6: "PIN locked.",
|
|
295
|
+
7: "SIM card is locked permanently.",
|
|
296
|
+
8: "suspension of transmission",
|
|
297
|
+
9: "Unopened"
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
@property
|
|
301
|
+
def network_type_info(self) -> str:
|
|
302
|
+
return self.network_types.get(self.network_type, "Unknown network type")
|
|
303
|
+
|
|
304
|
+
@property
|
|
305
|
+
def sim_status_info(self) -> str:
|
|
306
|
+
return self.sim_statuses.get(self.sim_status, "Unknown SIM status")
|
|
277
307
|
|
|
278
308
|
|
|
279
309
|
@dataclass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tplinkrouterc6u
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.10.1
|
|
4
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
|
|
@@ -258,7 +258,9 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
258
258
|
| enable | is enabled | int |
|
|
259
259
|
| connect_status | connect status | int |
|
|
260
260
|
| network_type | network type | int |
|
|
261
|
+
| network_type_info | Example: 4G LTE | str |
|
|
261
262
|
| sim_status | sim status | int |
|
|
263
|
+
| sim_status_info | Example: SIM locked. | str |
|
|
262
264
|
| total_statistics | total statistics in bytes | int |
|
|
263
265
|
| cur_rx_speed | current download speed in bytes per second | int |
|
|
264
266
|
| cur_tx_speed | current upload speed in bytes per second | int |
|
|
@@ -268,6 +270,8 @@ or you have TP-link C5400X or similar router you need to get web encrypted passw
|
|
|
268
270
|
| rsrq | RSRQ | int |
|
|
269
271
|
| snr | SNR | int |
|
|
270
272
|
| isp_name | ISP name | str |
|
|
273
|
+
| network_types | All possible network types - {0: "No Service", 1: "GSM", 2: "WCDMA", 3: "4G LTE", 4: "TD-SCDMA", 5: "CDMA 1x", 6: "CDMA 1x Ev-Do", 7: "4G+ LTE"} | dict |
|
|
274
|
+
| sim_statuses | All possible sim statuses - {0: "No SIM card detected or SIM card error.", 1: "No SIM card detected.", 2: "SIM card error.", 3: "SIM card prepared.", 4: "SIM locked.", 5: "SIM unlocked. Authentication succeeded.", 6: "PIN locked.", 7: "SIM card is locked permanently.", 8: "suspension of transmission", 9: "Unopened"} | dict |
|
|
271
275
|
|
|
272
276
|
## Enum
|
|
273
277
|
### <a id="connection">Connection</a>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tplinkrouterc6u-5.9.4 → tplinkrouterc6u-5.10.1}/tplinkrouterc6u.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|