Add custom JSONEncoder for subscribe_trigger WS endpoint (#48664)

This commit is contained in:
Jason 2021-04-09 20:47:10 -07:00 committed by GitHub
parent 324dd12db8
commit 7cc857a298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 69 deletions

View file

@ -11,6 +11,7 @@ from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.json import ExtendedJSONEncoder
from homeassistant.helpers.script import (
SCRIPT_BREAKPOINT_HIT,
SCRIPT_DEBUG_CONTINUE_ALL,
@ -24,7 +25,6 @@ from homeassistant.helpers.script import (
)
from .const import DATA_TRACE
from .utils import TraceJSONEncoder
# mypy: allow-untyped-calls, allow-untyped-defs
@ -71,7 +71,9 @@ def websocket_trace_get(hass, connection, msg):
message = websocket_api.messages.result_message(msg["id"], trace)
connection.send_message(json.dumps(message, cls=TraceJSONEncoder, allow_nan=False))
connection.send_message(
json.dumps(message, cls=ExtendedJSONEncoder, allow_nan=False)
)
def get_debug_traces(hass, key):