1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Prevent triggering twice

This commit is contained in:
Philip Lundrigan
2015-12-16 15:07:14 -07:00
parent fe2ae16210
commit 4c33eba378
2 changed files with 16 additions and 5 deletions

View File

@@ -274,15 +274,19 @@ class TestAutomationTemplate(unittest.TestCase):
self.hass.states.set('test.entity', 'work')
self.hass.pool.block_till_done()
self.assertEqual(2, len(self.calls))
self.assertEqual(1, len(self.calls))
self.hass.states.set('test.entity', 'not_home')
self.hass.pool.block_till_done()
self.assertEqual(1, len(self.calls))
self.hass.states.set('test.entity', 'world')
self.hass.pool.block_till_done()
self.assertEqual(2, len(self.calls))
self.assertEqual(1, len(self.calls))
self.hass.states.set('test.entity', 'home')
self.hass.pool.block_till_done()
self.assertEqual(3, len(self.calls))
self.assertEqual(2, len(self.calls))
def test_if_action(self):
automation.setup(self.hass, {