Law? Was this some town ordinance?
At the time this happened we were in the midst of an oil embargo. Whether it (law/rule) was local or Federal I can’t now tell you since it was over 30 years ago. Businesses were “told” to turn down thermostats and homeowners were requested to do the same.