Add exception translations to Notifications for Android TV / Fire TV (#171583)

This commit is contained in:
Manu
2026-05-20 16:54:03 +02:00
committed by GitHub
parent 00e3a909a0
commit 79fe415d6c
2 changed files with 13 additions and 2 deletions
+10 -2
View File
@@ -82,8 +82,11 @@ class NFAndroidTVNotificationService(BaseNotificationService):
try:
self.notify = Notifications(self.host)
except ConnectError as err:
_LOGGER.debug("Full exception:", exc_info=True)
raise HomeAssistantError(
f"Failed to connect to host: {self.host}"
translation_domain=DOMAIN,
translation_key="connection_failed",
translation_placeholders={CONF_HOST: self.host},
) from err
data: dict | None = kwargs.get(ATTR_DATA)
@@ -200,7 +203,12 @@ class NFAndroidTVNotificationService(BaseNotificationService):
image_file=image_file,
)
except ConnectError as err:
raise HomeAssistantError(f"Failed to connect to host: {self.host}") from err
_LOGGER.debug("Full exception:", exc_info=True)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="connection_failed",
translation_placeholders={CONF_HOST: self.host},
) from err
def load_file(
self,
@@ -31,6 +31,9 @@
}
},
"exceptions": {
"connection_failed": {
"message": "Failed to connect to host: {host}"
},
"invalid_notification_icon": {
"message": "Invalid icon data provided. Got {type}"
},