Merge changes I706933e7,If9b02192 into main

* changes:
  Use the latest temperature read as base for headroom calculation
  Revert "Use the latest temperature read as base for headroom calculation"