Automation: Add trigger context and expose to action

This commit is contained in:
Paulus Schoutsen committed 2016-04-21 13:59:42 -07:00
1 parent c4913a87e4
commit 4e568f8b99
20 files changed
+232 -69

No files matched your search

+6 -1
View File
@@ -176,7 +176,11 @@ class TestAutomationTime(unittest.TestCase):
'after': '5:00:00',
},
'action': {
'service': 'test.automation'
'service': 'test.automation',
'data_template': {
'some': '{{ trigger.platform }} - '
'{{ trigger.now.hour }}'
},
}
}
})
@@ -186,6 +190,7 @@ class TestAutomationTime(unittest.TestCase):
self.hass.pool.block_till_done()
self.assertEqual(1, len(self.calls))
self.assertEqual('time - 5', self.calls[0].data['some'])
def test_if_not_working_if_no_values_in_conf_provided(self):
"""Test for failure if no configuration."""