Power socket with built-in switching function