Fix blocking call in yale_smart_alarm (#125255)

pull/125420/head
G Johansson 2024-09-04 21:14:54 +02:00 committed by Paulus Schoutsen
parent 48fcf58eb9
commit 6c15f251c6
1 changed files with 4 additions and 2 deletions

View File

@ -36,8 +36,10 @@ class YaleDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
async def _async_setup(self) -> None:
"""Set up connection to Yale."""
try:
self.yale = YaleSmartAlarmClient(
self.entry.data[CONF_USERNAME], self.entry.data[CONF_PASSWORD]
self.yale = await self.hass.async_add_executor_job(
YaleSmartAlarmClient,
self.entry.data[CONF_USERNAME],
self.entry.data[CONF_PASSWORD],
)
except AuthenticationError as error:
raise ConfigEntryAuthFailed from error