A single-atom light switch