Any multifamily dwelling or single-family dwelling constructed on or after January 1, 2017, that has a fuel-fired heater or appliance, a fireplace, or an attached garage shall have a carbon monoxide alarm installed (1) on each habitable floor of each dwelling unit in a multifamily dwelling and on each habitable floor in a single-family dwelling or (2) in a location specified in any building code adopted by the state or by the political subdivision in which the dwelling is located.