Code for monitoring the temperature in a room and adjusting the temperature based on the current state and manual inputs