Add translation for ConfigEntryAuthFailed to lamarzocco (#131145)

pull/131221/head
Josef Zweck 2024-11-21 21:25:23 +01:00 committed by GitHub
parent 2a6e08caf9
commit de9f9f32c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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}"
},