In general, keep WD-40 away from anything mechanical. It has a solvent that dissolves grease (bad news for anything lubricated by grease), and once that evaporates, the remaining light oil is sticky and picks up crud (bad news for anything with moving parts).
If you've ever used it on a stiff lock, you'll know... it's great at first, but soon it's worse than it was originally. (Use graphite for locks, alcohol-carrier spray graphite if you need to flush some grit out.)
I would use mineral oil or silicone for something like a mechanical thermostat.
Maybe @Jan Pijpelink
can shed some science on this?