async def test_set_speed(hass):
    'Test setting the speed of the device.'
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_set_speed(hass, FAN_ENTITY_ID, fan.SPEED_LOW))
    assert (fan.SPEED_LOW == get_entity(hass).attributes.get('speed'))
Test setting the speed of the device.
async def test_set_speed(hass):
    
    assert (STATE_OFF == get_entity(hass).state)
    (await common.async_set_speed(hass, FAN_ENTITY_ID, fan.SPEED_LOW))
    assert (fan.SPEED_LOW == get_entity(hass).attributes.get('speed'))