From 99201833ffe685a2fd9f6873d824e8c3442f5452 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Fri, 26 Jun 2026 08:04:01 +0200 Subject: [PATCH] Fix GUI client references to nested pot params Update set_step(), status bar mass display, and on_action_sud_new() to read grain_mass/water_mass from step['pot'] and use the new pot key structure when sending an empty Load document. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01T52JH848ojhXXHn1bAzdC3 --- client/brewpi_gui.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/brewpi_gui.py b/client/brewpi_gui.py index 37639d4..c522451 100755 --- a/client/brewpi_gui.py +++ b/client/brewpi_gui.py @@ -330,8 +330,9 @@ class StepPlate(QtWidgets.QFrame): def set_step(self, step, resolved_temp): """Applies this step's static, schedule-config fields - called once, right after construction (see __init__).""" - grain = step.get('grain_mass', 0) - water = step.get('water_mass', 0) + step_pot = step.get('pot', {}) + grain = step_pot.get('grain_mass', 0) + water = step_pot.get('water_mass', 0) self.label_masses.setText("Grain {:.2f} kg / Water {:.2f} kg".format(grain, water)) ramp = step.get('ramp') or {} self.label_rate.setText("Rate {:.2f} °/min".format(ramp.get('rate', 0))) @@ -901,7 +902,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): # itself refuses this (like any Load) while a run is in progress, # surfacing an error (see on_sud_changed()'s 'Error' handling) # rather than the GUI trying to guess that here. - self.msg_sud.send({'Load': {'Name': '', 'Description': '', 'pot_mass': 0, 'pot_material': None, 'steps': []}}) + self.msg_sud.send({'Load': {'Name': '', 'Description': '', 'pot': {'mass': 0, 'material': None}, 'steps': []}}) def on_action_sud_save(self): # Pick the destination up front, on the GUI thread - the actual @@ -1209,7 +1210,8 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): # default.step there (see components/sud.py's _build_step()). if 0 <= self.sud_step_index < len(self.sud_schedule): step = self.sud_schedule[self.sud_step_index] - grain, water = step.get('grain_mass', 0), step.get('water_mass', 0) + step_pot = step.get('pot', {}) + grain, water = step_pot.get('grain_mass', 0), step_pot.get('water_mass', 0) else: grain, water = self.sud_grain_mass, self.sud_water_mass elif self.sud_schedule: