To keep it short here, NY State requires that when any type of permit (building, plumbing, electrical, etc) is pulled for work inside a building, smokes will be required to be installed. Depending on the conditions, hardwired and interconnected smokes will be required.
So a plumber files for a bathroom toilet, and the building department flags the job - assesses the property and requires smokes if the smokes are not up to code.
I'm in CT, but I hear that NY has adopted the same one and two family dwelling codes as us. Smokes are required in each bedroom, outside of the bedroom area, and on each additional level (including the basement). In new construction, they must be AC-DC and interconnected. If any other remodel work is done, they must be added, but battery units only without interconnection is allowed.
Just to clarify, under the International Residential Code, battery only untits w/o interconnection are allowed in remodels, only if interior wall or celing finishes are not being removed, and if there is no attic, crawlspace, etc. available to allow AC power supply and interconnection w/o removing finishes.