Reduce overhead to write HomeKit Controller state (#102365)

This commit is contained in:
J. Nick Koston 2023-10-19 20:50:07 -10:00 committed by GitHub
parent 84d0907fc8
commit 3014a651c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 30 deletions

View file

@ -1,4 +1,5 @@
"""Helper functions for the homekit_controller component."""
from functools import lru_cache
from typing import cast
from aiohomekit import Controller
@ -11,6 +12,7 @@ from .const import CONTROLLER
from .storage import async_get_entity_storage
@lru_cache
def folded_name(name: str) -> str:
"""Return a name that is used for matching a similar string."""
return name.casefold().replace(" ", "")