From 0fe23c82a4c8ef078095da221500f0e6844f6e2b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 3 Aug 2024 06:26:54 -0500 Subject: [PATCH] Remove unused variables in logbook LazyEventPartialState (#123097) --- homeassistant/components/logbook/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/logbook/models.py b/homeassistant/components/logbook/models.py index 2f9b2c8e289..93fc8885f57 100644 --- a/homeassistant/components/logbook/models.py +++ b/homeassistant/components/logbook/models.py @@ -45,8 +45,6 @@ class LazyEventPartialState: ) -> None: """Init the lazy event.""" 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 # to fetch row.data for Row is very expensive if type(row) is EventAsRow: @@ -60,10 +58,10 @@ class LazyEventPartialState: source = row.event_data if not source: self.data = {} - elif event_data := self._event_data_cache.get(source): + elif event_data := event_data_cache.get(source): self.data = event_data else: - self.data = self._event_data_cache[source] = cast( + self.data = event_data_cache[source] = cast( dict[str, Any], json_loads(source) )