Skip to content

Commit

Permalink
Increased timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrErohin committed May 15, 2024
1 parent 5eb5e12 commit 1bafdf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="tplinkrouterc6u",
version="4.0.1",
version="4.0.2",
author="Alex Erohin",
author_email="[email protected]",
description="TP-Link Router API",
Expand Down
10 changes: 5 additions & 5 deletions tplinkrouterc6u/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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'}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 1bafdf4

Please sign in to comment.