def test_is_on(self):
     """Test is_on method."""
     self.hass.states.set(ENTITY_ID, STATE_ON)
     self.hass.block_till_done()
     self.assertTrue(alert.is_on(self.hass, ENTITY_ID))
     self.hass.states.set(ENTITY_ID, STATE_OFF)
     self.hass.block_till_done()
     self.assertFalse(alert.is_on(self.hass, ENTITY_ID))
Beispiel #2
0
 def test_is_on(self):
     """Test is_on method."""
     self.hass.states.set(ENTITY_ID, STATE_ON)
     self.hass.block_till_done()
     self.assertTrue(alert.is_on(self.hass, ENTITY_ID))
     self.hass.states.set(ENTITY_ID, STATE_OFF)
     self.hass.block_till_done()
     self.assertFalse(alert.is_on(self.hass, ENTITY_ID))
Beispiel #3
0
 def test_is_on(self):
     """Test is_on method."""
     self.hass.states.set(ENTITY_ID, STATE_ON)
     self.hass.block_till_done()
     assert alert.is_on(self.hass, ENTITY_ID)
     self.hass.states.set(ENTITY_ID, STATE_OFF)
     self.hass.block_till_done()
     assert not alert.is_on(self.hass, ENTITY_ID)
async def test_is_on(hass):
    """Test is_on method."""
    hass.states.async_set(ENTITY_ID, STATE_ON)
    await hass.async_block_till_done()
    assert alert.is_on(hass, ENTITY_ID)
    hass.states.async_set(ENTITY_ID, STATE_OFF)
    await hass.async_block_till_done()
    assert not alert.is_on(hass, ENTITY_ID)
Beispiel #5
0
 def test_is_on(self):
     """Test is_on method."""
     self.hass.states.set(ENTITY_ID, STATE_ON)
     self.hass.block_till_done()
     assert alert.is_on(self.hass, ENTITY_ID)
     self.hass.states.set(ENTITY_ID, STATE_OFF)
     self.hass.block_till_done()
     assert not alert.is_on(self.hass, ENTITY_ID)