From a0b8ad16baa9c43845974c4a82efdbc60919a5e5 Mon Sep 17 00:00:00 2001 From: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:41:09 -0600 Subject: [PATCH] Add remaining HEOS exception translations (#136878) Add coordinator exc translations --- homeassistant/components/heos/coordinator.py | 12 ++++++++++-- homeassistant/components/heos/quality_scale.yaml | 2 +- homeassistant/components/heos/strings.json | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/heos/coordinator.py b/homeassistant/components/heos/coordinator.py index dc8989fd55bb4c..94aa4ad0ab5a36 100644 --- a/homeassistant/components/heos/coordinator.py +++ b/homeassistant/components/heos/coordinator.py @@ -82,12 +82,20 @@ async def async_setup(self) -> None: try: await self.heos.connect() except HeosError as error: - raise ConfigEntryNotReady from error + _LOGGER.debug("Unable to connect to %s", self.host, exc_info=True) + raise ConfigEntryNotReady( + translation_domain=DOMAIN, + translation_key="unable_to_connect", + translation_placeholders={"host": self.host}, + ) from error # Load players try: await self.heos.get_players() except HeosError as error: - raise ConfigEntryNotReady from error + _LOGGER.debug("Unexpected error retrieving players", exc_info=True) + raise ConfigEntryNotReady( + translation_domain=DOMAIN, translation_key="unable_to_get_players" + ) from error if not self.heos.is_signed_in: _LOGGER.warning( diff --git a/homeassistant/components/heos/quality_scale.yaml b/homeassistant/components/heos/quality_scale.yaml index f5066d0a7438f6..67022ec492cf63 100644 --- a/homeassistant/components/heos/quality_scale.yaml +++ b/homeassistant/components/heos/quality_scale.yaml @@ -54,7 +54,7 @@ rules: entity-device-class: done entity-disabled-by-default: done entity-translations: done - exception-translations: todo + exception-translations: done icon-translations: done reconfiguration-flow: done repair-issues: todo diff --git a/homeassistant/components/heos/strings.json b/homeassistant/components/heos/strings.json index 4092d4360db0ea..53e20a032b522b 100644 --- a/homeassistant/components/heos/strings.json +++ b/homeassistant/components/heos/strings.json @@ -112,6 +112,12 @@ "not_heos_media_player": { "message": "Entity {entity_id} is not a HEOS media player entity" }, + "unable_to_connect": { + "message": "Unable to connect to {host}" + }, + "unable_to_get_players": { + "message": "Unexpected error retrieving players" + }, "unknown_source": { "message": "Unknown source: {source}" }