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:
Paulus Schoutsen 2019-05-14 05:57:47 +02:00 committed by GitHub
parent b2a1204bc5
commit 45085dd97f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 20 deletions

View file

@ -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)