Automation: Add trigger context and expose to action
This commit is contained in:
parent
c4913a87e4
commit
4e568f8b99
20 changed files with 232 additions and 69 deletions
|
@ -26,7 +26,12 @@ def trigger(hass, config, action):
|
|||
"""Listen for events and calls the action when data matches."""
|
||||
if not event_data or all(val == event.data.get(key) for key, val
|
||||
in event_data.items()):
|
||||
action()
|
||||
action({
|
||||
'trigger': {
|
||||
'platform': 'event',
|
||||
'event': event,
|
||||
},
|
||||
})
|
||||
|
||||
hass.bus.listen(event_type, handle_event)
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue