Condition for one temperature being lower than another?

Maybe change the cooling and warming flags to something like:

      {% set cooling = out + 1 < in %}
      {% set warming = out - 1 > in %}