From 2f7d48b2cbd1cc6f4e4894914e982b884ad01d95 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 21 Jun 2026 00:32:55 +0200 Subject: [PATCH] Revert Sud hold "duration" back to minutes Reverts 19dc7a9 ("Fix Sud hold duration units: seconds, not minutes") per explicit instruction - duration is minutes again. Re-adds the *60.0 conversion in Sud._advance() (hold_remaining is ticked in simulated seconds), the matching conversion in the forecast plot's _estimate_course(), and flips the README wording back. --- README.md | 2 +- client/brewpi_gui.py | 2 +- components/sud.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c3ba55..f5e7aa1 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Files under `sude/` describe a brew's mash schedule ("Sud"): `pot_mass`, - a ramp — `"ramp": {"rate": ..., "temp": ...}` — ramp to `temp` at `rate` (°C/min), or - a hold — `"hold": {"duration": ...}` — hold the current target for - `duration` seconds (omit/`0` for an immediate step). + `duration` minutes (omit/`0` for an immediate step). Both `ramp` and `hold` carry a `stirrer` block (`speed`, `interval_time`, `on_ratio`): `interval_time: 0` runs the stirrer continuously at `speed`; diff --git a/client/brewpi_gui.py b/client/brewpi_gui.py index 9187088..7b6b7b8 100755 --- a/client/brewpi_gui.py +++ b/client/brewpi_gui.py @@ -143,7 +143,7 @@ class SudForecastPlot(FigureCanvasQTAgg): t.append(t[-1] + abs(target - theta[-1]) / rate * 60.0) theta.append(target) elif hold is not None: - t.append(t[-1] + hold.get('duration', 0)) + t.append(t[-1] + hold.get('duration', 0) * 60.0) theta.append(theta[-1]) return t, theta diff --git a/components/sud.py b/components/sud.py index d931b83..87d81ac 100644 --- a/components/sud.py +++ b/components/sud.py @@ -178,7 +178,9 @@ class Sud(AttributeChange): if 'ramp' in next_step: self.state = SudState.RAMPING else: - self.hold_remaining = next_step['hold'].get('duration', 0) + # "duration" is in minutes; hold_remaining (ticked by tick()'s + # simulated-seconds dt) is in seconds. + self.hold_remaining = next_step['hold'].get('duration', 0) * 60.0 self.state = SudState.HOLDING self.user_message = next_step.get('user_message')