Automation: Add trigger context and expose to action

This commit is contained in:
Paulus Schoutsen 2016-04-21 13:59:42 -07:00
parent c4913a87e4
commit 4e568f8b99
20 changed files with 232 additions and 69 deletions

View file

@ -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