Fix trigger config validation (#147408)

This commit is contained in:
Erik Montnemery
2025-06-24 10:13:44 +02:00
committed by GitHub
parent c67b497f30
commit b8044f60fc
2 changed files with 94 additions and 3 deletions

View File

@@ -271,7 +271,7 @@ async def async_validate_trigger_config(
if hasattr(platform, "async_get_triggers"):
trigger_descriptors = await platform.async_get_triggers(hass)
trigger_key: str = conf[CONF_PLATFORM]
if not (trigger := trigger_descriptors[trigger_key]):
if not (trigger := trigger_descriptors.get(trigger_key)):
raise vol.Invalid(f"Invalid trigger '{trigger_key}' specified")
conf = await trigger.async_validate_trigger_config(hass, conf)
elif hasattr(platform, "async_validate_trigger_config"):