mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Add missing exception translation to Home Connect (#139218)
Add missing exception translation
This commit is contained in:
parent
b662d32e44
commit
b86bb75e5e
@ -213,7 +213,11 @@ async def _get_client_and_ha_id(
|
|||||||
break
|
break
|
||||||
if entry is None:
|
if entry is None:
|
||||||
raise ServiceValidationError(
|
raise ServiceValidationError(
|
||||||
"Home Connect config entry not found for that device id"
|
translation_domain=DOMAIN,
|
||||||
|
translation_key="config_entry_not_found",
|
||||||
|
translation_placeholders={
|
||||||
|
"device_id": device_id,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
ha_id = next(
|
ha_id = next(
|
||||||
|
@ -33,6 +33,9 @@
|
|||||||
"appliance_not_found": {
|
"appliance_not_found": {
|
||||||
"message": "Appliance for device ID {device_id} not found"
|
"message": "Appliance for device ID {device_id} not found"
|
||||||
},
|
},
|
||||||
|
"config_entry_not_found": {
|
||||||
|
"message": "Config entry for device ID {device_id} not found"
|
||||||
|
},
|
||||||
"turn_on_light": {
|
"turn_on_light": {
|
||||||
"message": "Error turning on {entity_id}: {error}"
|
"message": "Error turning on {entity_id}: {error}"
|
||||||
},
|
},
|
||||||
|
@ -589,9 +589,7 @@ async def test_services_appliance_not_found(
|
|||||||
)
|
)
|
||||||
service_call["service_data"]["device_id"] = device_entry.id
|
service_call["service_data"]["device_id"] = device_entry.id
|
||||||
|
|
||||||
with pytest.raises(
|
with pytest.raises(ServiceValidationError, match=r"Config entry.*not found"):
|
||||||
ServiceValidationError, match=r"Home Connect config entry.*not found"
|
|
||||||
):
|
|
||||||
await hass.services.async_call(**service_call)
|
await hass.services.async_call(**service_call)
|
||||||
|
|
||||||
device_entry = device_registry.async_get_or_create(
|
device_entry = device_registry.async_get_or_create(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user