Convert States to dicts via as_dict only once (#41208)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick KostonandPaulus Schoutsen authored and GitHub committed 2020-10-05 09:18:57 -05:00
1 parent 2f54bf29ba
commit 4798f37c6e
4 files changed
+63 -20

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@ class Events(Base): # type: ignore
return Events(
event_type=event.event_type,
event_data=event_data or json.dumps(event.data, cls=JSONEncoder),
origin=str(event.origin),
origin=str(event.origin.value),
time_fired=event.time_fired,
context_id=event.context.id,
context_user_id=event.context.user_id,