Smart battery discharger