An occupancy switch is equipped with a sensor that detects when someone walks into a room and turns on the light. The light stays on for a preset amount of time, and if the sensor does not detect any motion for that period, it switches off the light to conserve power.