Merge pull request #404 from stefan-jonasson/automation_confg_list

Automation confg lists
This commit is contained in:
Paulus Schoutsen committed 2015-09-19 20:53:26 -07:00
commit 85489010bc
2 files changed
+71 -13

No files matched your search

+38
View File
@@ -340,3 +340,41 @@ class TestAutomation(unittest.TestCase):
self.hass.bus.fire('test_event')
self.hass.pool.block_till_done()
self.assertEqual(1, len(self.calls))
def test_automation_list_setting(self):
""" Event is not a valid condition. Will it still work? """
automation.setup(self.hass, {
automation.DOMAIN: [
{
'trigger': [
{
'platform': 'event',
'event_type': 'test_event',
},
],
'action': {
'execute_service': 'test.automation',
}
},
{
'trigger': [
{
'platform': 'event',
'event_type': 'test_event_2',
},
],
'action': {
'execute_service': 'test.automation',
}
}
]
})
self.hass.bus.fire('test_event')
self.hass.pool.block_till_done()
self.assertEqual(1, len(self.calls))
self.hass.bus.fire('test_event_2')
self.hass.pool.block_till_done()
self.assertEqual(2, len(self.calls))