Add translations to all Sensibo errors (#134422)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
G Johansson 2025-01-02 10:46:55 +01:00 committed by GitHub
parent 51ccba12af
commit 8a45aa4c42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

View File

@ -54,10 +54,17 @@ class SensiboDataUpdateCoordinator(DataUpdateCoordinator[SensiboData]):
try:
data = await self.client.async_get_devices_data()
except AuthenticationError as error:
raise ConfigEntryAuthFailed from error
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_key="auth_error",
) from error
except SensiboError as error:
raise UpdateFailed from error
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="update_error",
translation_placeholders={"error": str(error)},
) from error
if not data.raw:
raise UpdateFailed("No devices found")
raise UpdateFailed(translation_domain=DOMAIN, translation_key="no_data")
return data

View File

@ -561,6 +561,15 @@
},
"climate_react_not_available": {
"message": "Use Sensibo Enable Climate React action once to enable switch or the Sensibo app"
},
"auth_error": {
"message": "Authentication failed, please update your API key"
},
"update_error": {
"message": "There was an error updating from the Sensibo API with the error: {error}"
},
"no_data": {
"message": "No devices found, ensure your Sensibo devices are correctly set up and have a remote defined"
}
}
}