From 7a543af8ee56dcd3e43733882a217a678342f3c5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Apr 2024 21:45:08 -1000 Subject: [PATCH] Simplify homekit_controller cache clear (#114692) --- homeassistant/components/homekit_controller/entity.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/homeassistant/components/homekit_controller/entity.py b/homeassistant/components/homekit_controller/entity.py index 136c063f280..c5478ccb97d 100644 --- a/homeassistant/components/homekit_controller/entity.py +++ b/homeassistant/components/homekit_controller/entity.py @@ -2,7 +2,6 @@ from __future__ import annotations -import contextlib from typing import Any from aiohomekit.model.characteristics import ( @@ -80,11 +79,7 @@ class HomeKitEntity(Entity): def _async_clear_property_cache(self, properties: tuple[str, ...]) -> None: """Clear the cache of properties.""" for prop in properties: - # suppress is slower than try-except-pass, but - # we do not expect to have many properties to clear - # or this to be called often. - with contextlib.suppress(AttributeError): - delattr(self, prop) + self.__dict__.pop(prop, None) @callback def _async_reconfigure(self) -> None: