Update trigger validation message (#126749)
parent
662a704165
commit
33d83e43de
|
@ -225,7 +225,7 @@ async def _async_get_trigger_platform(
|
|||
try:
|
||||
integration = await async_get_integration(hass, platform)
|
||||
except IntegrationNotFound:
|
||||
raise vol.Invalid(f"Invalid platform '{platform}' specified") from None
|
||||
raise vol.Invalid(f"Invalid trigger '{platform}' specified") from None
|
||||
try:
|
||||
return await integration.async_get_platform("trigger")
|
||||
except ImportError:
|
||||
|
|
|
@ -2601,7 +2601,7 @@ async def test_validate_config_works(
|
|||
(
|
||||
"triggers",
|
||||
{"platform": "non_existing", "event_type": "hello"},
|
||||
"Invalid platform 'non_existing' specified",
|
||||
"Invalid trigger 'non_existing' specified",
|
||||
),
|
||||
# Raises vol.Invalid
|
||||
(
|
||||
|
|
|
@ -20,7 +20,7 @@ async def test_bad_trigger_platform(hass: HomeAssistant) -> None:
|
|||
"""Test bad trigger platform."""
|
||||
with pytest.raises(vol.Invalid) as ex:
|
||||
await async_validate_trigger_config(hass, [{"platform": "not_a_platform"}])
|
||||
assert "Invalid platform 'not_a_platform' specified" in str(ex)
|
||||
assert "Invalid trigger 'not_a_platform' specified" in str(ex)
|
||||
|
||||
|
||||
async def test_trigger_subtype(hass: HomeAssistant) -> None:
|
||||
|
|
Loading…
Reference in New Issue