You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a public method to close the underlying httpx.AsyncClient #28
SaicApiClient creates and owns an httpx.AsyncClient, but neither it nor AbstractSaicApi exposes a way to close it. A consumer that constructs a SaicApi, experiences a failed login (or simply finishes using the client), and then tries to clean up has no supported way to release the transport — so the underlying HTTP client stays open until garbage collection or process exit. Under repeated failed logins this leaks connections.
Would you accept a small, additive PR adding async def close() to both SaicApiClient (closing its httpx.AsyncClient via aclose()) and AbstractSaicApi (delegating to the client)? It's backward-compatible — nothing existing changes. Happy to open it. Context: this came up in the mg-saic-ha Home Assistant integration, which currently has to reach the private client to close it.
changed the title [-]No public method to close the underlying httpx.AsyncClient[/-][+]Add a public method to close the underlying httpx.AsyncClient[/+]on Jul 19, 2026
Activity
[-]No public method to close the underlying httpx.AsyncClient[/-][+]Add a public method to close the underlying httpx.AsyncClient[/+]nanomad commentedon Oct 17, 2026
Accepted. Added
close()toSaicApiClientandAbstractSaicApiin #31. Thanks for the suggestion.nanomad commentedon Oct 17, 2026
@townsmcp Thank you for the suggestion and for the context from
mg-saic-ha. The change is merged and will go out in the next release.