change smoke detector python script to digital in 4