Append name char value from the service to HomeKit Controller Entities (#74359)

This commit is contained in:
J. Nick Koston
2022-07-03 15:47:54 -05:00
committed by GitHub
parent 737a1fd9fa
commit 30a5df5895
26 changed files with 662 additions and 145 deletions

View File

@@ -10,6 +10,11 @@ from homeassistant.core import Event, HomeAssistant
from .const import CONTROLLER
def folded_name(name: str) -> str:
"""Return a name that is used for matching a similar string."""
return name.casefold().replace(" ", "")
async def async_get_controller(hass: HomeAssistant) -> Controller:
"""Get or create an aiohomekit Controller instance."""
if existing := hass.data.get(CONTROLLER):