Better handle large amounts of data being sent over WS (#23842)
* Better handle large amounts of data being sent over WS * Lint
This commit is contained in:
parent
b2a1204bc5
commit
45085dd97f
7 changed files with 59 additions and 20 deletions
|
@ -1,6 +1,9 @@
|
|||
"""Websocket constants."""
|
||||
import asyncio
|
||||
from concurrent import futures
|
||||
from functools import partial
|
||||
import json
|
||||
from homeassistant.helpers.json import JSONEncoder
|
||||
|
||||
DOMAIN = 'websocket_api'
|
||||
URL = '/api/websocket'
|
||||
|
@ -27,3 +30,5 @@ SIGNAL_WEBSOCKET_DISCONNECTED = 'websocket_disconnected'
|
|||
|
||||
# Data used to store the current connection list
|
||||
DATA_CONNECTIONS = DOMAIN + '.connections'
|
||||
|
||||
JSON_DUMP = partial(json.dumps, cls=JSONEncoder, allow_nan=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue