Lawyers representing tenants who live in the city’s public housing projects are appealing a judge’s ruling tossing their lawsuit for back rent from the New York City Housing Authority for the months it couldn’t keep the heat on.

“NYCHA has a legal and moral obligation to ensure that heat and hot water systems are functioning properly, and when that promise is broken, there is a price that must be paid,” said Legal Aid Society lawyer Lucy Newman.

The initial complaint stemmed from NYCHA’s disastrous heating during the 2017-2018 winter, when 320,000 residents lost heat and the outages lasted for nearly a day on average.

A Manhattan Supreme Court judge tossed the lawsuit in February 2019, ruling that it was preempted by the deal City Hall struck with US Department of Housing and Urban Development.

NYCHA’s aging boilers failed again last winter as heating outages struck 339,000 residents during the most recent heating season, though the outages were fixed in less than half the time compared to the year before.

A spokesman for the authority declined to comment.