Add missing exception translations to Comelit (#142861)

* Add missing exception translations to Comelit

* update quality scale

* remove unwanted placeholder
This commit is contained in:
Simone Chemelli 2025-04-25 18:34:29 +02:00 committed by GitHub
parent 0aabb11220
commit 735e2e4192
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 6 deletions

View File

@ -96,9 +96,16 @@ class ComelitBaseCoordinator(DataUpdateCoordinator[T]):
await self.api.login()
return await self._async_update_system_data()
except (CannotConnect, CannotRetrieveData) as err:
raise UpdateFailed(repr(err)) from err
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="update_failed",
translation_placeholders={"error": repr(err)},
) from err
except CannotAuthenticate as err:
raise ConfigEntryAuthFailed from err
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_key="cannot_authenticate",
) from err
@abstractmethod
async def _async_update_system_data(self) -> T:

View File

@ -70,9 +70,7 @@ rules:
entity-device-class: done
entity-disabled-by-default: done
entity-translations: done
exception-translations:
status: todo
comment: PR in progress
exception-translations: done
icon-translations: done
reconfiguration-flow:
status: todo

View File

@ -74,7 +74,10 @@
"message": "Error connecting: {error}"
},
"cannot_authenticate": {
"message": "Error authenticating: {error}"
"message": "Error authenticating"
},
"updated_failed": {
"message": "Failed to update data: {error}"
}
}
}