mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Add exception translations to Notifications for Android TV / Fire TV (#171583)
This commit is contained in:
@@ -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}"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user