From 68af566e793fac05e65836d01dcb91f7452a403b Mon Sep 17 00:00:00 2001 From: Austin Mroczek Date: Mon, 23 Dec 2024 16:22:12 +0000 Subject: [PATCH] handle ResultCode -123 --- total_connect_client/client.py | 4 +--- total_connect_client/const.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/total_connect_client/client.py b/total_connect_client/client.py index a5b82de..f6e4d84 100644 --- a/total_connect_client/client.py +++ b/total_connect_client/client.py @@ -179,9 +179,7 @@ def raise_for_resultcode(self, response): ): return self._raise_for_retry(response) - if rc == _ResultCode.BAD_USER_OR_PASSWORD: - raise AuthenticationError(rc.name, response) - if rc == _ResultCode.AUTHENTICATION_FAILED: + if rc in (_ResultCode.BAD_USER_OR_PASSWORD, _ResultCode.AUTHENTICATION_FAILED, _ResultCode.ACCOUNT_LOCKED): raise AuthenticationError(rc.name, response) if rc == _ResultCode.USER_CODE_UNAVAILABLE: raise UsercodeUnavailable(rc.name, response) diff --git a/total_connect_client/const.py b/total_connect_client/const.py index ef7f8fe..b4b1dab 100644 --- a/total_connect_client/const.py +++ b/total_connect_client/const.py @@ -178,6 +178,7 @@ def from_response(response_dict): INVALID_SESSION = -102 AUTHENTICATION_FAILED = -100 CONNECTION_ERROR = 4101 + ACCOUNT_LOCKED = -123 PROJECT_URL = "https://github.com/craigjmidwinter/total-connect-client"