From 0ab1ccc5ae2f7b7dd32c8dc3b1203477e3ff7271 Mon Sep 17 00:00:00 2001 From: Marcel Vriend <92307684+marcelvriend@users.noreply.github.com> Date: Sun, 21 Jul 2024 14:08:58 +0200 Subject: [PATCH] Fix to prevent Azure Data Explorer JSON serialization from failing (#122300) --- homeassistant/components/azure_data_explorer/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/azure_data_explorer/__init__.py b/homeassistant/components/azure_data_explorer/__init__.py index 319f7e4389b..34f2c438d14 100644 --- a/homeassistant/components/azure_data_explorer/__init__.py +++ b/homeassistant/components/azure_data_explorer/__init__.py @@ -18,7 +18,7 @@ from homeassistant.core import Event, HomeAssistant, State from homeassistant.exceptions import ConfigEntryError from homeassistant.helpers.entityfilter import FILTER_SCHEMA 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.util.dt import utcnow @@ -203,9 +203,7 @@ class AzureDataExplorer: return None, dropped if (utcnow() - time_fired).seconds > DEFAULT_MAX_DELAY + self._send_interval: 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)