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() await self.api.login()
return await self._async_update_system_data() return await self._async_update_system_data()
except (CannotConnect, CannotRetrieveData) as err: 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: except CannotAuthenticate as err:
raise ConfigEntryAuthFailed from err raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_key="cannot_authenticate",
) from err
@abstractmethod @abstractmethod
async def _async_update_system_data(self) -> T: async def _async_update_system_data(self) -> T:

View File

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

View File

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