Averaging works given that the maximum deviation is not too high. Probably 40...36 averaging to 38 works "well enough" for most people.

But there is an another issue, namely that it's more difficult to control the cooldown repeatably than to continuously control the temperature. The cooldown rate depends on so many factors such as the volume of solution, room temperature, agitation, etc. With room temperature deviations from 22 degC in winter to 30 degC in summer, I would not trust the temperature averaging very much. (Specifically, AFAIK, the thermal energy loss is directly proportional to dT so if the developer drops from 40 C to 36 C at 22 C environment, it will drop from 40 C to 38 C at 30 C environment. A big difference.)

Try it first with water, using a thermometer known to react quickly, taking a reading every minute.