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:
2026-06-21 09:42:09 +02:00
parent b72977d6cb
commit e62863ca93
+3 -2
View File
@@ -86,8 +86,9 @@ if __name__ == '__main__':
# Assign temp. sensor readings to tc # Assign temp. sensor readings to tc
sensor_task.set_on_changed("temp", ChangedFloat(tc.set_theta_ist, prec=2).set) sensor_task.set_on_changed("temp", ChangedFloat(tc.set_theta_ist, prec=2).set)
# Assign heater power set to tc model # Assign heater power set to tc model - "Normal" has no internal model
heater.set_on_changed("power_set", tc.set_model_power) if hasattr(tc, "set_model_power"):
heater.set_on_changed("power_set", tc.set_model_power)
# For simulation # For simulation
if "sim" in config['Controller']['sensor_name']: if "sim" in config['Controller']['sensor_name']: