mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Initial script condition support (#1910)
This commit is contained in:
@@ -146,12 +146,12 @@ class TestAutomation(unittest.TestCase):
|
||||
],
|
||||
'condition': [
|
||||
{
|
||||
'platform': 'state',
|
||||
'condition': 'state',
|
||||
'entity_id': entity_id,
|
||||
'state': '100'
|
||||
},
|
||||
{
|
||||
'platform': 'numeric_state',
|
||||
'condition': 'numeric_state',
|
||||
'entity_id': entity_id,
|
||||
'below': 150
|
||||
}
|
||||
@@ -231,6 +231,7 @@ class TestAutomation(unittest.TestCase):
|
||||
{
|
||||
'platform': 'state',
|
||||
'entity_id': entity_id,
|
||||
'from': '120',
|
||||
'state': '100'
|
||||
},
|
||||
{
|
||||
@@ -248,10 +249,14 @@ class TestAutomation(unittest.TestCase):
|
||||
|
||||
self.hass.states.set(entity_id, 100)
|
||||
self.hass.pool.block_till_done()
|
||||
self.assertEqual(2, len(self.calls))
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
self.hass.states.set(entity_id, 120)
|
||||
self.hass.pool.block_till_done()
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
self.hass.states.set(entity_id, 100)
|
||||
self.hass.pool.block_till_done()
|
||||
self.assertEqual(2, len(self.calls))
|
||||
|
||||
self.hass.states.set(entity_id, 151)
|
||||
|
||||
Reference in New Issue
Block a user