Migrate event component (EventTrigger)

This commit is contained in:
J. Nick Koston
2026-03-25 15:17:05 -10:00
parent bdc4a54613
commit 73ae0dd739
+3 -2
View File
@@ -92,8 +92,9 @@ def event_schema(
@setup_entity("event")
async def setup_event_core_(var, config, *, event_types: list[str]):
for conf in config.get(CONF_ON_EVENT, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(cg.StringRef, "event_type")], conf)
await automation.build_callback_automation(
var, "add_on_event_callback", [(cg.StringRef, "event_type")], conf
)
cg.add(var.set_event_types(event_types))