Battery automatic discharge method