Added Error Handling for Thermostat

Added a try catch block around the code that checks the thermostat to
handle invalid data being returned.