From 5befe51c424c1a8ad83cc6a670150a74a6c73ad4 Mon Sep 17 00:00:00 2001 From: Steven B <51370195+sdb9696@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:01:58 +0100 Subject: [PATCH] Ensure http delay logic works during default login attempt (#959) Ensures retryable exceptions are raised on failure to login with default login credentials. --- kasa/aestransport.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kasa/aestransport.py b/kasa/aestransport.py index 427801e1..68250b1a 100644 --- a/kasa/aestransport.py +++ b/kasa/aestransport.py @@ -28,6 +28,8 @@ from .exceptions import ( DeviceError, KasaException, SmartErrorCode, + TimeoutError, + _ConnectionError, _RetryableError, ) from .httpclient import HttpClient @@ -220,7 +222,7 @@ class AesTransport(BaseTransport): "%s: logged in with default credentials", self._host, ) - except AuthenticationError: + except (AuthenticationError, _ConnectionError, TimeoutError): raise except Exception as ex: raise KasaException(