mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Initial orjson support (#72754)
This commit is contained in:
@@ -14,6 +14,7 @@ from aiohttp import web
|
||||
from aiohttp.hdrs import CONTENT_TYPE, USER_AGENT
|
||||
from aiohttp.web_exceptions import HTTPBadGateway, HTTPGatewayTimeout
|
||||
import async_timeout
|
||||
import orjson
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE, __version__
|
||||
@@ -97,6 +98,7 @@ def _async_create_clientsession(
|
||||
"""Create a new ClientSession with kwargs, i.e. for cookies."""
|
||||
clientsession = aiohttp.ClientSession(
|
||||
connector=_async_get_connector(hass, verify_ssl),
|
||||
json_serialize=lambda x: orjson.dumps(x).decode("utf-8"),
|
||||
**kwargs,
|
||||
)
|
||||
# Prevent packages accidentally overriding our default headers
|
||||
|
||||
Reference in New Issue
Block a user