Thermostat bug fix