TempControllerBase: require PID gains via set_params(), not the constructor

Mirrors components/pid/pid.py's own Pid.set_params() pattern: params/
thresholds start out None, and set_params() configures pid_hold/pid_heat/
pid_cool from them. process()/process_fsm() fail naturally (TypeError on
None) if called before set_params() - same as Pid.process() already does -
rather than a new bespoke check. Updates all callers (server/brewpi.py,
SudForecastEstimator, and the pid/sud demo scripts) to call set_params()
right after construction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DkkuG48uHFCGKe6dPSERFk
This commit is contained in:
2026-06-22 18:21:20 +02:00
co-authored by Claude Sonnet 4.6
parent 296d3a333d
commit 0a6d3e6462
8 changed files with 27 additions and 15 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ class SudForecastEstimator:
pot.set_plant_params(self.plant_params)
pot.set_ambient_temperature(self.theta_amb)
pot.initial(start_theta)
tc = PidFactory.create(self.pid_type, self.dt, self.tempctrl_params, self.plant_params, theta_amb=self.theta_amb)
tc = PidFactory.create(self.pid_type, self.dt, self.plant_params, theta_amb=self.theta_amb)
tc.set_params(self.tempctrl_params)
tc.set_enabled(True)
tc.set_theta_ist(pot.get_temperature())
# Seed the target at start_theta - this tc is a fresh, throwaway