Switch between battery and plug