From 54843bb4223804388c2557fad4ad6480487e03a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Diego=20Rodr=C3=ADguez=20Royo?= Date: Tue, 25 Feb 2025 02:21:25 +0100 Subject: [PATCH] Add missing exception translation to Home Connect (#139223) --- homeassistant/components/home_connect/__init__.py | 8 +++++++- homeassistant/components/home_connect/strings.json | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/home_connect/__init__.py b/homeassistant/components/home_connect/__init__.py index 405606c6159..3e1bd1da156 100644 --- a/homeassistant/components/home_connect/__init__.py +++ b/homeassistant/components/home_connect/__init__.py @@ -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) diff --git a/homeassistant/components/home_connect/strings.json b/homeassistant/components/home_connect/strings.json index 5072bb616dd..672ad364365 100644 --- a/homeassistant/components/home_connect/strings.json +++ b/homeassistant/components/home_connect/strings.json @@ -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" },