Skip to content

Commit

Permalink
πŸ› Avoid error when dumping event to json
Browse files Browse the repository at this point in the history
This will ease investigations
  • Loading branch information
kamaradclimber committed Jan 11, 2025
1 parent 1bb7585 commit 0870390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/datadog_agentless/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ def full_all_event_listener(creds: dict, events_queue, event: Event):

tags = ["service:home-assistant", f"version:{HAVERSION}", f"event_type:{event.event_type}", f"env:{creds['env']}"]
if event.event_type == homeassistant.const.EVENT_STATE_CHANGED:
text=json.dumps(orjson.loads(orjson.dumps(event.json_fragment)))
text=json.dumps(orjson.loads(orjson.dumps(event.json_fragment, default=str)))
else:
text=json.dumps(event.as_dict())
text=json.dumps(event.as_dict(), default=str)
title, event_specific_tags = generate_message(event)
event_request = EventCreateRequest(
date_happened=int(event.time_fired.timestamp()),
Expand Down

0 comments on commit 0870390

Please sign in to comment.