From 1bafdf46399f7e1902fbf74cc904adafb3905657 Mon Sep 17 00:00:00 2001 From: Alex Erohin Date: Wed, 15 May 2024 10:21:03 +0300 Subject: [PATCH] Increased timeout --- setup.py | 2 +- tplinkrouterc6u/client.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 890be11..c1e01e0 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="tplinkrouterc6u", - version="4.0.1", + version="4.0.2", author="Alex Erohin", author_email="alexanderErohin@yandex.ru", description="TP-Link Router API", diff --git a/tplinkrouterc6u/client.py b/tplinkrouterc6u/client.py index f999ce2..40b864d 100644 --- a/tplinkrouterc6u/client.py +++ b/tplinkrouterc6u/client.py @@ -269,7 +269,7 @@ class TplinkBaseRouter(AbstractRouter, TplinkRequest): _perf_status = True def __init__(self, host: str, password: str, username: str = 'admin', logger: Logger = None, - verify_ssl: bool = True, timeout: int = 10) -> None: + verify_ssl: bool = True, timeout: int = 30) -> None: super().__init__(host, password, username, logger, verify_ssl, timeout) self._url_firmware = 'admin/firmware?form=upgrade&operation=read' @@ -468,7 +468,7 @@ def _map_wire_type(data: str | None, host: bool = True) -> Connection: class TplinkRouter(TplinkEncryption, TplinkBaseRouter): def __init__(self, host: str, password: str, username: str = 'admin', logger: Logger = None, - verify_ssl: bool = True, timeout: int = 10) -> None: + verify_ssl: bool = True, timeout: int = 30) -> None: super().__init__(host, password, username, logger, verify_ssl, timeout) self._url_firmware = 'admin/firmware?form=upgrade' @@ -478,7 +478,7 @@ def __init__(self, host: str, password: str, username: str = 'admin', logger: Lo class TPLinkDecoClient(TplinkEncryption, AbstractRouter): def __init__(self, host: str, password: str, username: str = 'admin', logger: Logger = None, - verify_ssl: bool = True, timeout: int = 10) -> None: + verify_ssl: bool = True, timeout: int = 30) -> None: super().__init__(host, password, username, logger, verify_ssl, timeout) self._headers_request = {'Content-Type': 'application/json'} @@ -751,7 +751,7 @@ def __init__(self, type: int, oid: str, stack: str = '0,0,0,0,0,0', pstack: str self.attrs = attrs def __init__(self, host: str, password: str, username: str = 'admin', logger: Logger = None, - verify_ssl: bool = True, timeout: int = 10) -> None: + verify_ssl: bool = True, timeout: int = 30) -> None: super().__init__(host, password, username, logger, verify_ssl, timeout) self.req = requests.Session() @@ -1251,7 +1251,7 @@ def _prepare_data(self, data: str, is_login: bool) -> tuple[str, str]: class TplinkRouterProvider: @staticmethod def get_client(host: str, password: str, username: str = 'admin', logger: Logger = None, - verify_ssl: bool = True, timeout: int = 10) -> AbstractRouter | None: + verify_ssl: bool = True, timeout: int = 30) -> AbstractRouter | None: for client in [TPLinkMRClient, TplinkC6V4Router, TPLinkDecoClient, TplinkRouter, TplinkC1200Router]: router = client(host, password, username, logger, verify_ssl, timeout) if router.supports():