Ensure Schlage exceptions are translated (#131733)

pull/131873/head^2
David Knowles 2024-11-28 23:34:20 -05:00 committed by GitHub
parent 28cfa37248
commit 954ac0d288
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -56,7 +56,9 @@ class SchlageDataUpdateCoordinator(DataUpdateCoordinator[SchlageData]):
except NotAuthorizedError as ex:
raise ConfigEntryAuthFailed from ex
except SchlageError as ex:
raise UpdateFailed("Failed to refresh Schlage data") from ex
raise UpdateFailed(
translation_domain=DOMAIN, translation_key="schlage_refresh_failed"
) from ex
lock_data = await asyncio.gather(
*(
self.hass.async_add_executor_job(self._get_lock_data, lock)

View File

@ -53,5 +53,10 @@
"name": "1-Touch Locking"
}
}
},
"exceptions": {
"schlage_refresh_failed": {
"message": "Failed to refresh Schlage data"
}
}
}