Ceiling fan controller?

The switch you tied to the motor I do not believe is rated for motors and you’ve probably ruined your fan.