mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Add cache to split_entity_id (#71345)
This commit is contained in:
@ -133,9 +133,12 @@ SOURCE_YAML = ConfigSource.YAML.value
|
||||
# How long to wait until things that run on startup have to finish.
|
||||
TIMEOUT_EVENT_START = 15
|
||||
|
||||
MAX_EXPECTED_ENTITY_IDS = 16384
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@functools.lru_cache(MAX_EXPECTED_ENTITY_IDS)
|
||||
def split_entity_id(entity_id: str) -> tuple[str, str]:
|
||||
"""Split a state entity ID into domain and object ID."""
|
||||
domain, _, object_id = entity_id.partition(".")
|
||||
|
Reference in New Issue
Block a user