From ea9204750257802d92fa1fef49756ba8744553e4 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 5 May 2025 09:49:30 +0200 Subject: [PATCH] Make name a non cached property --- homeassistant/helpers/entity.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 3819e02a744..cc75a9f7632 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -18,6 +18,7 @@ import time from types import FunctionType from typing import TYPE_CHECKING, Any, Final, Literal, NotRequired, TypedDict, final +from propcache.api import cached_property import voluptuous as vol from homeassistant.const import ( @@ -62,8 +63,6 @@ from .event import ( from .frame import report_non_thread_safe_operation from .typing import UNDEFINED, StateType, UndefinedType -cached_property = property - timer = time.time if TYPE_CHECKING: @@ -414,7 +413,6 @@ CACHED_PROPERTIES_WITH_ATTR_ = { "extra_state_attributes", "force_update", "icon", - "name", "should_poll", "state", "supported_features", @@ -731,7 +729,7 @@ class Entity( name = self.name return None if name is UNDEFINED else name - @cached_property + @property def name(self) -> str | UndefinedType | None: """Return the name of the entity.""" # The check for self.platform guards against integrations not using an