From c0afc3a9d7149a2ac23c85be001d9dcbd0c531ef Mon Sep 17 00:00:00 2001 From: James Townsend Date: Sun, 19 Jul 2026 11:00:14 +0100 Subject: [PATCH 1/2] Implement close method for HTTP client Added a close method to release HTTP client connections. --- src/saic_ismart_client_ng/net/client/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/saic_ismart_client_ng/net/client/__init__.py b/src/saic_ismart_client_ng/net/client/__init__.py index 172ae61..89b9d46 100644 --- a/src/saic_ismart_client_ng/net/client/__init__.py +++ b/src/saic_ismart_client_ng/net/client/__init__.py @@ -38,6 +38,10 @@ def __init__( async def send(self, request: Request) -> Response: return await self.__client.send(request) + async def close(self) -> None: + """Close the underlying HTTP client and release its connections.""" + await self.__client.aclose() + @property def user_token(self) -> str: return self.__user_token From 8ea9dba951f67cb00ce20913d450a670fdeb248e Mon Sep 17 00:00:00 2001 From: James Townsend Date: Sun, 19 Jul 2026 11:01:05 +0100 Subject: [PATCH 2/2] Implement close method for API client Added a close method to the API client for resource management. --- src/saic_ismart_client_ng/api/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/saic_ismart_client_ng/api/base.py b/src/saic_ismart_client_ng/api/base.py index 7e382c0..fb27d69 100644 --- a/src/saic_ismart_client_ng/api/base.py +++ b/src/saic_ismart_client_ng/api/base.py @@ -53,6 +53,10 @@ def __init__( self.__api_client = SaicApiClient(configuration, listener=listener) self.__token_expiration: datetime.datetime | None = None + async def close(self) -> None: + """Close the API client and release its HTTP resources.""" + await self.__api_client.close() + async def login(self) -> LoginResp: headers = { "Content-Type": "application/x-www-form-urlencoded",