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:
+2
-1
@@ -88,7 +88,8 @@ if __name__ == '__main__':
|
||||
taskmgr.add(heater_task)
|
||||
|
||||
# Temperature Controller
|
||||
tc = PidFactory.create(config['Controller']['pid_type'], DT, config['TempCtrl'], DEFAULT_PLANT_PARAMS, theta_amb=theta_amb)
|
||||
tc = PidFactory.create(config['Controller']['pid_type'], DT, DEFAULT_PLANT_PARAMS, theta_amb=theta_amb)
|
||||
tc.set_params(config['TempCtrl'])
|
||||
tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl"))
|
||||
taskmgr.add(tc_task)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user