async def test_set_direction(hass):
    'Test setting the direction of the device.'
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_set_direction(hass, FAN_ENTITY_ID, fan.DIRECTION_REVERSE))
    assert (fan.DIRECTION_REVERSE == get_entity(hass).attributes.get('direction'))
Test setting the direction of the device.
async def test_set_direction(hass):
    
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_set_direction(hass, FAN_ENTITY_ID, fan.DIRECTION_REVERSE))
    assert (fan.DIRECTION_REVERSE == get_entity(hass).attributes.get('direction'))