'Test vacuum service to set the fan speed.'

def test_set_fan_speed(self):

    group_vacuums = ','.join([ENTITY_VACUUM_BASIC, ENTITY_VACUUM_COMPLETE])
    old_state_basic = self.hass.states.get(ENTITY_VACUUM_BASIC)
    old_state_complete = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    vacuum.set_fan_speed(self.hass, FAN_SPEEDS[0], entity_id=group_vacuums)
    self.hass.block_till_done()
    new_state_basic = self.hass.states.get(ENTITY_VACUUM_BASIC)
    new_state_complete = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertEqual(old_state_basic, new_state_basic)
    self.assertNotIn(ATTR_FAN_SPEED, new_state_basic.attributes)
    self.assertNotEqual(old_state_complete, new_state_complete)
    self.assertEqual(FAN_SPEEDS[1], old_state_complete.attributes[ATTR_FAN_SPEED])
    self.assertEqual(FAN_SPEEDS[0], new_state_complete.attributes[ATTR_FAN_SPEED])
