mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-23 15:58:02 +00:00
Fix slow aestransport and cli tests (#816)
This commit is contained in:
@@ -38,7 +38,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ONE_DAY_SECONDS = 86400
|
||||
SESSION_EXPIRE_BUFFER_SECONDS = 60 * 20
|
||||
BACKOFF_SECONDS_AFTER_LOGIN_ERROR = 1
|
||||
|
||||
|
||||
def _sha1(payload: bytes) -> str:
|
||||
@@ -72,6 +71,7 @@ class AesTransport(BaseTransport):
|
||||
}
|
||||
CONTENT_LENGTH = "Content-Length"
|
||||
KEY_PAIR_CONTENT_LENGTH = 314
|
||||
BACKOFF_SECONDS_AFTER_LOGIN_ERROR = 1
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -213,7 +213,7 @@ class AesTransport(BaseTransport):
|
||||
self._default_credentials = get_default_credentials(
|
||||
DEFAULT_CREDENTIALS["TAPO"]
|
||||
)
|
||||
await asyncio.sleep(BACKOFF_SECONDS_AFTER_LOGIN_ERROR)
|
||||
await asyncio.sleep(self.BACKOFF_SECONDS_AFTER_LOGIN_ERROR)
|
||||
await self.perform_handshake()
|
||||
await self.try_login(self._get_login_params(self._default_credentials))
|
||||
_LOGGER.debug(
|
||||
|
Reference in New Issue
Block a user