Classes | |
| class | HassHttpXAsyncClient |
Functions | |
| None | _async_register_async_client_shutdown (HomeAssistant hass, httpx.AsyncClient client, Callable[[], Coroutine[Any, Any, None]] original_aclose) |
| httpx.AsyncClient | create_async_httpx_client (HomeAssistant hass, bool verify_ssl=True, bool auto_cleanup=True, SSLCipherList ssl_cipher_list=SSLCipherList.PYTHON_DEFAULT, **Any kwargs) |
| httpx.AsyncClient | get_async_client (HomeAssistant hass, bool verify_ssl=True) |
Variables | |
| DEFAULT_LIMITS = httpx.Limits(keepalive_expiry=KEEP_ALIVE_TIMEOUT) | |
| int | KEEP_ALIVE_TIMEOUT = 15 |
| tuple | SERVER_SOFTWARE |
| string | USER_AGENT = "User-Agent" |
Helper for httpx.
|
private |
Register httpx AsyncClient aclose on Home Assistant shutdown. This method must be run in the event loop.
Definition at line 105 of file httpx_client.py.
| httpx.AsyncClient homeassistant.helpers.httpx_client.create_async_httpx_client | ( | HomeAssistant | hass, |
| bool | verify_ssl = True, |
||
| bool | auto_cleanup = True, |
||
| SSLCipherList | ssl_cipher_list = SSLCipherList.PYTHON_DEFAULT, |
||
| **Any | kwargs | ||
| ) |
Create a new httpx.AsyncClient with kwargs, i.e. for cookies. If auto_cleanup is False, the client will be automatically closed on homeassistant_stop. This method must be run in the event loop.
Definition at line 66 of file httpx_client.py.
| httpx.AsyncClient homeassistant.helpers.httpx_client.get_async_client | ( | HomeAssistant | hass, |
| bool | verify_ssl = True |
||
| ) |
Return default httpx AsyncClient. This method must be run in the event loop.
Definition at line 41 of file httpx_client.py.
| homeassistant.helpers.httpx_client.DEFAULT_LIMITS = httpx.Limits(keepalive_expiry=KEEP_ALIVE_TIMEOUT) |
Definition at line 31 of file httpx_client.py.
| int homeassistant.helpers.httpx_client.KEEP_ALIVE_TIMEOUT = 15 |
Definition at line 26 of file httpx_client.py.
| tuple homeassistant.helpers.httpx_client.SERVER_SOFTWARE |
Definition at line 32 of file httpx_client.py.
| string homeassistant.helpers.httpx_client.USER_AGENT = "User-Agent" |
Definition at line 36 of file httpx_client.py.