Keep plant/temp control inert until a Sud is actually loaded
server/brewpi.py no longer pre-configures the real Pot's or Smith's model's plant params at startup - there's no longer any generic baseline at all, since the only source of truth is now a loaded Sud's own doc (applied via tasks/sud.py's SudTask.apply_plant_params(), on Load and on every step). Ambient temperature and PID gains stay configured at startup, since they're independent of any Sud (global setting / hardware tuning, not doc-derived). Add Pot.is_configured() (already existed)/TempControllerBase.is_configured()/ TempController(Smith).is_configured(), and have tasks/pot.py's PotTask and tasks/tempctrl.py's TcTask skip process() while not yet configured instead of letting it raise - so plant and temp control are genuinely inert (not crashing) until a Sud is loaded. "Normal" has no plant-model dependency, so it stays active regardless. Also refreshes README.md: removes stale tracer.py/.mat references (already removed in an earlier commit), documents SudLogTask's JSON logs, the doc's L/Td fields, and this inert-until-loaded behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DkkuG48uHFCGKe6dPSERFk
This commit is contained in:
+7
-1
@@ -71,6 +71,12 @@ class TcTask(ATask):
|
||||
await self.send({'Enabled': self.tc.enabled})
|
||||
|
||||
while True:
|
||||
self.tc.process()
|
||||
# Stays inert until set_params() (and, for a model-based
|
||||
# controller like Smith, its model's plant params/ambient too
|
||||
# - see components/pid/temp_controller_smith.py's
|
||||
# is_configured()) has actually been supplied - process()
|
||||
# would otherwise raise.
|
||||
if self.tc.is_configured():
|
||||
self.tc.process()
|
||||
await asyncio.sleep(self.interval)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user