diff --git a/src/thermostat/thermostat.rs b/src/thermostat/thermostat.rs index bd7718a..a5e7b5e 100644 --- a/src/thermostat/thermostat.rs +++ b/src/thermostat/thermostat.rs @@ -345,6 +345,8 @@ impl Thermostat{ } pub fn set_temperature_setpoint(&mut self, t: ThermodynamicTemperature) { + let temp_mon_settings = self.temp_mon.get_settings(); + let t = t.min(temp_mon_settings.upper_limit).max(temp_mon_settings.lower_limit); self.pid_ctrl_ch0.set_pid_setpoint(t); self.temp_mon.set_setpoint(t); }