From de9f9f32c75fb4fa8da496c1ee5faab517b3d490 Mon Sep 17 00:00:00 2001 From: Josef Zweck <24647999+zweckj@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:25:23 +0100 Subject: [PATCH] Add translation for ConfigEntryAuthFailed to lamarzocco (#131145) --- homeassistant/components/lamarzocco/coordinator.py | 7 ++++--- homeassistant/components/lamarzocco/strings.json | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lamarzocco/coordinator.py b/homeassistant/components/lamarzocco/coordinator.py index 05fee98c599..646aad0e8dd 100644 --- a/homeassistant/components/lamarzocco/coordinator.py +++ b/homeassistant/components/lamarzocco/coordinator.py @@ -126,9 +126,10 @@ class LaMarzoccoUpdateCoordinator(DataUpdateCoordinator[None]): try: await func(*args, **kwargs) except AuthFail as ex: - msg = "Authentication failed." - _LOGGER.debug(msg, exc_info=True) - raise ConfigEntryAuthFailed(msg) from ex + _LOGGER.debug("Authentication failed", exc_info=True) + raise ConfigEntryAuthFailed( + translation_domain=DOMAIN, translation_key="authentication_failed" + ) from ex except RequestNotSuccessful as ex: _LOGGER.debug(ex, exc_info=True) raise UpdateFailed(f"Querying API failed. Error: {ex}") from ex diff --git a/homeassistant/components/lamarzocco/strings.json b/homeassistant/components/lamarzocco/strings.json index 959dda265a9..f9621d7cd3b 100644 --- a/homeassistant/components/lamarzocco/strings.json +++ b/homeassistant/components/lamarzocco/strings.json @@ -196,6 +196,9 @@ } }, "exceptions": { + "authentication_failed": { + "message": "Authentication failed" + }, "auto_on_off_error": { "message": "Error while setting auto on/off to {state} for {id}" },