Пример #1
0
    def test_is_on(self):
        """Test is on service call."""
        self.assertFalse(fan.is_on(self.hass, FAN_ENTITY_ID))

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertTrue(fan.is_on(self.hass, FAN_ENTITY_ID))
Пример #2
0
    def test_is_on(self):
        """Test is on service call."""
        self.assertFalse(fan.is_on(self.hass, FAN_ENTITY_ID))

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.pool.block_till_done()
        self.assertTrue(fan.is_on(self.hass, FAN_ENTITY_ID))
Пример #3
0
async def test_is_on(hass):
    """Test is on service call."""
    assert not fan.is_on(hass, FAN_ENTITY_ID)

    common.async_turn_on(hass, FAN_ENTITY_ID)
    await hass.async_block_till_done()
    assert fan.is_on(hass, FAN_ENTITY_ID)
Пример #4
0
async def test_is_on(hass):
    """Test is on service call."""
    assert not fan.is_on(hass, FAN_ENTITY_ID)

    common.async_turn_on(hass, FAN_ENTITY_ID)
    await hass.async_block_till_done()
    assert fan.is_on(hass, FAN_ENTITY_ID)
Пример #5
0
async def test_is_on(hass, fan_entity_id):
    """Test is on service call."""
    assert not fan.is_on(hass, fan_entity_id)

    await hass.services.async_call(
        fan.DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: fan_entity_id}, blocking=True
    )
    assert fan.is_on(hass, fan_entity_id)
Пример #6
0
async def test_is_on(hass):
    """Test is on service call."""
    assert not fan.is_on(hass, FAN_ENTITY_ID)

    await common.async_turn_on(hass, FAN_ENTITY_ID)
    assert fan.is_on(hass, FAN_ENTITY_ID)