mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Remove unused variables in logbook LazyEventPartialState (#123097)
This commit is contained in:
parent
61cbb77042
commit
0fe23c82a4
@ -45,8 +45,6 @@ class LazyEventPartialState:
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Init the lazy event."""
|
"""Init the lazy event."""
|
||||||
self.row = row
|
self.row = row
|
||||||
self._event_data: dict[str, Any] | None = None
|
|
||||||
self._event_data_cache = event_data_cache
|
|
||||||
# We need to explicitly check for the row is EventAsRow as the unhappy path
|
# We need to explicitly check for the row is EventAsRow as the unhappy path
|
||||||
# to fetch row.data for Row is very expensive
|
# to fetch row.data for Row is very expensive
|
||||||
if type(row) is EventAsRow:
|
if type(row) is EventAsRow:
|
||||||
@ -60,10 +58,10 @@ class LazyEventPartialState:
|
|||||||
source = row.event_data
|
source = row.event_data
|
||||||
if not source:
|
if not source:
|
||||||
self.data = {}
|
self.data = {}
|
||||||
elif event_data := self._event_data_cache.get(source):
|
elif event_data := event_data_cache.get(source):
|
||||||
self.data = event_data
|
self.data = event_data
|
||||||
else:
|
else:
|
||||||
self.data = self._event_data_cache[source] = cast(
|
self.data = event_data_cache[source] = cast(
|
||||||
dict[str, Any], json_loads(source)
|
dict[str, Any], json_loads(source)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user