From cf4c02b9fa75ae4bb9533410d3ab8cd446d8d435 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 3 Apr 2024 00:20:32 -1000 Subject: [PATCH] Simplify core state cache clear (#114694) same as #113136 but for core --- homeassistant/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/core.py b/homeassistant/core.py index 58e94d63352..1edeb666492 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -440,8 +440,7 @@ class HomeAssistant: """Set the current state.""" self.state = state for prop in ("is_running", "is_stopping"): - with suppress(AttributeError): - delattr(self, prop) + self.__dict__.pop(prop, None) def start(self) -> int: """Start Home Assistant.