async def test_turn_on(hass):
    'Test turning on 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_on(hass, FAN_ENTITY_ID, fan.SPEED_HIGH))
    assert (STATE_ON == get_entity(hass).state)
    assert (fan.SPEED_HIGH == get_entity(hass).attributes[fan.ATTR_SPEED])
Test turning on the device.
async def test_turn_on(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_on(hass, FAN_ENTITY_ID, fan.SPEED_HIGH))
    assert (STATE_ON == get_entity(hass).state)
    assert (fan.SPEED_HIGH == get_entity(hass).attributes[fan.ATTR_SPEED])