diff --git a/tasks/tempctrl.py b/tasks/tempctrl.py index 0ac0354..21d50b1 100644 --- a/tasks/tempctrl.py +++ b/tasks/tempctrl.py @@ -78,5 +78,19 @@ class TcTask(ATask): # would otherwise raise. if self.tc.is_configured(): self.tc.process() + else: + # Smith's model plant params only ever arrive from a Sud's + # doc (see brewpi.py), so right after server start - before + # any Sud has ever loaded - is_configured() stays False and + # process() never runs. Without this, theta_ist/ + # heatrate_ist/heatrate_soll (and thus the 'Ist'/'Soll' + # messages below) would stay frozen at their __init__ + # defaults forever, leaving the GUI's Ist Temp/Rate and + # Soll Rate displays blank on connect. Mirror the raw + # sensor reading straight through instead - there's no + # controller output yet to report a real rate for. + self.tc.theta_ist = self.tc.get_theta_ist_set() + self.tc.heatrate_ist = 0.0 + self.tc.heatrate_soll = 0.0 await asyncio.sleep(self.interval)