UPS with temperature-compensated charging