From c60fdff74db8025b76fbe8d88c9bbf41f215d413 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 11 Jul 2026 12:17:13 +0200 Subject: [PATCH] docs: check off set_model_power gap in PID design backlog Already fixed in 2f2067d (no-op stub on TempControllerBase, 2026-06-25) but the TODO entry was never marked done. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01F4oEE99rkKVU8L8tkzXWdG --- components/pid/TODO.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/pid/TODO.md b/components/pid/TODO.md index 62a7c9b..cb1e0d0 100644 --- a/components/pid/TODO.md +++ b/components/pid/TODO.md @@ -44,16 +44,16 @@ git history for `temp_controller.py`/`temp_controller_smith.py`). the two-model Smith correction itself still have no dedicated coverage. This drives a physical heater — worth extending. -- [ ] **`set_model_power` isn't defined on every controller, but - `brewpi.py` wires it unconditionally.** `brewpi.py` always does - `heater.set_on_changed("power_set", tc.set_model_power)` regardless - of `Controller.pid_type`. Only `temp_controller_smith.py` (the Smith - predictor) defines `set_model_power`; `temp_controller.py` (`"Normal"`) - does not, so starting the server with `"pid_type": "Normal"` crashes - at wiring time with `AttributeError: 'TempController' object has no - attribute 'set_model_power'`. Either add a no-op `set_model_power` to - `TempControllerBase`, or only wire it when the configured controller - actually exposes a model to feed. +- [x] **`set_model_power` isn't defined on every controller, but + `brewpi.py` wires it unconditionally.** Fixed: `TempControllerBase` + now has a no-op `set_model_power`/`set_ambient_temperature`/ + `set_model_plant_params` (`temp_controller_base.py:83-90`), so + `brewpi.py`'s unconditional `heater.set_on_changed("power_set", + tc.set_model_power)` no longer crashes for `"pid_type": "Normal"` - + `temp_controller_smith.py` still overrides `set_model_power` to + actually feed its internal model. The redundant `hasattr()` guards + at both call sites (`brewpi.py`, `components/sud_forecast.py`) were + removed along with it. - [ ] **Config access is unchecked `dict[key]` everywhere.** `params['Hold']`, `params['Td']`, etc., throughout, with no schema