added switch case to check that device is a temp sensor before initializing it as one