From b72977d6cb82ec115593be0c8f541a7d1b5b8bfa Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 21 Jun 2026 09:36:40 +0200 Subject: [PATCH] Fix pid_type "Normal" crashing on startup PidFactory.create() calls both controllers with the same (dt, params, model_params, theta_amb=...) signature, but TempController ("Normal") only accepted (dt, params) - any config using pid_type "Normal" would crash with a TypeError on startup. It has no internal model, so just accepts and ignores the extra arguments. --- components/pid/temp_controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/pid/temp_controller.py b/components/pid/temp_controller.py index e0b9a16..c7dba24 100644 --- a/components/pid/temp_controller.py +++ b/components/pid/temp_controller.py @@ -2,7 +2,10 @@ from components.pid.temp_controller_base import TempControllerBase class TempController(TempControllerBase): - def __init__(self, dt, params): + def __init__(self, dt, params, model_params=None, theta_amb=20): + # model_params/theta_amb are accepted (but unused) for constructor + # compatibility with TempControllerSmith - PidFactory.create() calls + # either with the same arguments; "Normal" has no internal model. TempControllerBase.__init__(self, dt, params) self.dt = dt self.last_theta_ist = 20