mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Fix to prevent Azure Data Explorer JSON serialization from failing (#122300)
This commit is contained in:
parent
48661054d9
commit
0ab1ccc5ae
@ -18,7 +18,7 @@ from homeassistant.core import Event, HomeAssistant, State
|
|||||||
from homeassistant.exceptions import ConfigEntryError
|
from homeassistant.exceptions import ConfigEntryError
|
||||||
from homeassistant.helpers.entityfilter import FILTER_SCHEMA
|
from homeassistant.helpers.entityfilter import FILTER_SCHEMA
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
from homeassistant.helpers.json import JSONEncoder
|
from homeassistant.helpers.json import ExtendedJSONEncoder
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
|
|
||||||
@ -203,9 +203,7 @@ class AzureDataExplorer:
|
|||||||
return None, dropped
|
return None, dropped
|
||||||
if (utcnow() - time_fired).seconds > DEFAULT_MAX_DELAY + self._send_interval:
|
if (utcnow() - time_fired).seconds > DEFAULT_MAX_DELAY + self._send_interval:
|
||||||
return None, dropped + 1
|
return None, dropped + 1
|
||||||
if "\n" in state.state:
|
|
||||||
return None, dropped + 1
|
|
||||||
|
|
||||||
json_event = json.dumps(obj=state, cls=JSONEncoder)
|
json_event = json.dumps(obj=state, cls=ExtendedJSONEncoder)
|
||||||
|
|
||||||
return (json_event, dropped)
|
return (json_event, dropped)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user