mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add translations to all Sensibo errors (#134422)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
51ccba12af
commit
8a45aa4c42
@ -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
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user