Tesla is being sued for a recent over-the-air update that seems to have artificially shortened the range on some older model batteries.

Things are tough for Tesla right now. They lost almost half a billion dollars in the second quarter of 2019, and some of their older cars have started to randomly catch fire. That's pretty bad publicity.

Now they're also getting sued. Apparently, a recent software update has limited the voltage on some older-model battery packs and that's knocked as much as 40 miles off their maximum range.

The suit was filed Wednesday in Northern California federal court and seeks class-action status for owners of older Tesla Model S and Xs. The suit accuses Tesla of shortening the range of 85 kWh battery packs (which were discontinued in 2016) in order to extend the battery's longevity.

Plaintiff David Rasmussen did an interview with Electrek where he described a significant drop in the maximum range for his Tesla Model S after a May software update. He actually recorded the indicated max range after every recharge for the past 100,000 miles and found he'd lost 40 miles off his range after the May update. That reduced his Model S's range from around 245 miles to just over 215 miles.

RELATED: The Fresco Motors Reverie Electric Sedan Hopes To Give Tesla A Run For Its Money

Tesla told Rasmussen that this was "normal degradation" of the battery pack over time and refused to cover a replacement under warranty. With no other option, he sued.

Model S
via Tesla

Rasmussen said that the likeliest reason for the sudden reduction in range is to prevent more random meltdowns of older Tesla vehicles. A Model S caught fire in a Shanghai parking garage in April, and it seems to have been tied to the battery’s voltage. The software update released in May reduced the battery’s maximum voltage but consequently reduced its maximum range and how fast the battery can charge.

Tesla sent a statement to Electrek that said only a "very small percentage" of Model S and X owners will see a "small reduction" in range, and that the changes were done to improve battery longevity.

NEXT: Free Supercharging Is Back For Tesla Model S, X In Bid To Boost Sales