Add missing exception translation to Home Connect (#139223)

This commit is contained in:
J. Diego Rodríguez Royo 2025-02-25 02:21:25 +01:00 committed by GitHub
parent c115a7f455
commit 54843bb422
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -203,7 +203,13 @@ async def _get_client_and_ha_id(
device_registry = dr.async_get(hass)
device_entry = device_registry.async_get(device_id)
if device_entry is None:
raise ServiceValidationError("Device entry not found for device id")
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="device_entry_not_found",
translation_placeholders={
"device_id": device_id,
},
)
entry: HomeConnectConfigEntry | None = None
for entry_id in device_entry.config_entries:
_entry = hass.config_entries.async_get_entry(entry_id)

View File

@ -33,6 +33,9 @@
"appliance_not_found": {
"message": "Appliance for device ID {device_id} not found"
},
"device_entry_not_found": {
"message": "Device entry for device ID {device_id} not found"
},
"config_entry_not_found": {
"message": "Config entry for device ID {device_id} not found"
},