Make TemplateStateBase.entity_id a cached_property (#122279)

pull/122312/head
J. Nick Koston 2024-07-21 07:49:59 -05:00 committed by GitHub
parent 0ab1ccc5ae
commit a8cbfe5159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ from collections.abc import Callable, Generator, Iterable
from contextlib import AbstractContextManager from contextlib import AbstractContextManager
from contextvars import ContextVar from contextvars import ContextVar
from datetime import date, datetime, time, timedelta from datetime import date, datetime, time, timedelta
from functools import cache, lru_cache, partial, wraps from functools import cache, cached_property, lru_cache, partial, wraps
import json import json
import logging import logging
import math import math
@ -1022,7 +1022,7 @@ class TemplateStateBase(State):
return self.state_with_unit return self.state_with_unit
raise KeyError raise KeyError
@property @cached_property
def entity_id(self) -> str: # type: ignore[override] def entity_id(self) -> str: # type: ignore[override]
"""Wrap State.entity_id. """Wrap State.entity_id.