Fake pins
The thermostat talks to its sensor, relay and clock through three function pointers, so tests swap in fakes: scripted temperatures, a recorded relay, and a clock that runs twelve minutes of thermostat life in a fraction of a second.
Open it in the simulator