UPS inverter with a battery