Fix blocking call in yale_smart_alarm (#125255)

This commit is contained in:
G Johansson 2024-09-04 21:14:54 +02:00 committed by GitHub
parent b23297bb7e
commit b61678d39c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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