async def test_turn_off(hass):
    'Test turning off the device.'
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_turn_on(hass, FAN_ENTITY_ID))
    assert (STATE_OFF != get_entity(hass).state)
    (await common.async_turn_off(hass, FAN_ENTITY_ID))
    assert (STATE_OFF == get_entity(hass).state)
Test turning off the device.
async def test_turn_off(hass):
    
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_turn_on(hass, FAN_ENTITY_ID))
    assert (STATE_OFF != get_entity(hass).state)
    (await common.async_turn_off(hass, FAN_ENTITY_ID))
    assert (STATE_OFF == get_entity(hass).state)