Puzzle: the lazy electrician

Here's a brain teaser from the Art of Play newsletter. I have not tried to solve it yet.

A lazy electrician is hired to fix the wiring in a tall building. In the basement are three buttons labeled, "A, B & C." On the top floor of the building there are three ceiling fans in three different apartments labeled, "1, 2 & 3." The landlord tells the electrician that each button in the basement is connected to one of the three fans upstairs—press the button once, and the fan turns on. Press it twice, and that same fan turns off. The problem is, no one knows which button controls which fan.

There is no elevator in the building and the electrician is very lazy so he will only climb up the stairs to the top floor once. It will take him nearly an hour to climb all the stairs and he refuses to use any assistance of any kind in order to complete this job. If it is impossible to see the fans from outside of their respective apartments, how does the electrician discover which button controls which fan once he climbs up the stairs for the first (and last) time?