A programme for a smart thermostat, built in JS