mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Use compact encoding for JSON websocket messages (#67148)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
5366c0e3e3
commit
c9e46d360b
@ -480,7 +480,9 @@ async def handle_subscribe_trigger(
|
|||||||
msg["id"], {"variables": variables, "context": context}
|
msg["id"], {"variables": variables, "context": context}
|
||||||
)
|
)
|
||||||
connection.send_message(
|
connection.send_message(
|
||||||
json.dumps(message, cls=ExtendedJSONEncoder, allow_nan=False)
|
json.dumps(
|
||||||
|
message, cls=ExtendedJSONEncoder, allow_nan=False, separators=(",", ":")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
connection.subscriptions[msg["id"]] = (
|
connection.subscriptions[msg["id"]] = (
|
||||||
|
@ -53,4 +53,6 @@ SIGNAL_WEBSOCKET_DISCONNECTED: Final = "websocket_disconnected"
|
|||||||
# Data used to store the current connection list
|
# Data used to store the current connection list
|
||||||
DATA_CONNECTIONS: Final = f"{DOMAIN}.connections"
|
DATA_CONNECTIONS: Final = f"{DOMAIN}.connections"
|
||||||
|
|
||||||
JSON_DUMP: Final = partial(json.dumps, cls=JSONEncoder, allow_nan=False)
|
JSON_DUMP: Final = partial(
|
||||||
|
json.dumps, cls=JSONEncoder, allow_nan=False, separators=(",", ":")
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user