Fix pid_type "Normal" crashing on startup (part 2)
Found while live-testing the previous fix: brewpi.py unconditionally wired heater.power_set to tc.set_model_power, but "Normal" has no internal model and thus no such method - same hasattr guard already used elsewhere (tasks/sud.py's apply_plant_params) for this.
This commit is contained in:
+3
-2
@@ -86,8 +86,9 @@ if __name__ == '__main__':
|
||||
# Assign temp. sensor readings to tc
|
||||
sensor_task.set_on_changed("temp", ChangedFloat(tc.set_theta_ist, prec=2).set)
|
||||
|
||||
# Assign heater power set to tc model
|
||||
heater.set_on_changed("power_set", tc.set_model_power)
|
||||
# Assign heater power set to tc model - "Normal" has no internal model
|
||||
if hasattr(tc, "set_model_power"):
|
||||
heater.set_on_changed("power_set", tc.set_model_power)
|
||||
|
||||
# For simulation
|
||||
if "sim" in config['Controller']['sensor_name']:
|
||||
|
||||
Reference in New Issue
Block a user