Complex sentence: The desired effect is to switch the unit off whenever the cord is removed, a side effect is to flatten the battery if it is not, for example if equipment is left connected overnight.
Split into simpler sentences: The desired effect is to switch the unit off whenever the cord is removed. A side effect is to discharge the battery if it is not removed, for example if equipment is left connected overnight.