Skip to content

Commit

Permalink
Add remaining HEOS exception translations (#136878)
Browse files Browse the repository at this point in the history
Add coordinator exc translations
  • Loading branch information
andrewsayre authored Feb 6, 2025
1 parent fd6e2a6 commit a0b8ad1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
12 changes: 10 additions & 2 deletions homeassistant/components/heos/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/heos/quality_scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/heos/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down

0 comments on commit a0b8ad1

Please sign in to comment.