Add exception translations to Broadlink (#189026)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joost Lekkerkerker
2026-10-28 10:12:42 +01:00
committed by GitHub
co-authored by Claude
parent 0bb73bad5a
commit 97c4916bc9
2 changed files with 9 additions and 1 deletions
@@ -136,6 +136,9 @@
},
"unload_failed": {
"message": "Failed to unload the device"
},
"update_failed": {
"message": "Failed to update the device"
}
}
}
@@ -11,6 +11,8 @@ from broadlink_async.exceptions import AuthorizationError, BroadlinkException
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.util import dt as dt_util
from .const import DOMAIN
if TYPE_CHECKING:
from .device import BroadlinkDevice
@@ -96,7 +98,10 @@ class BroadlinkUpdateManager(ABC, Generic[_ApiT]): # noqa: UP046
# will skip listener notification, so notify explicitly to
# ensure entities flip to unavailable on this transition.
self.coordinator.async_update_listeners()
raise UpdateFailed(err) from err
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="update_failed",
) from err
if self.available is False:
_LOGGER.warning(