thermferm/thermferm.c

changeset 367
b9130db48c63
parent 364
2f9bbbcd2407
child 395
e32e83550963
--- a/thermferm/thermferm.c	Tue Jun 02 14:03:46 2015 +0200
+++ b/thermferm/thermferm.c	Tue Jun 02 14:14:20 2015 +0200
@@ -255,12 +255,14 @@
     syslog(LOG_NOTICE, "Mode from %s to %s via panel interface", UNITMODE[current_unit->mode], UNITMODE[mode]);
     current_unit->mode = mode;
     /* Allways turn everything off after a mode change */
-    current_unit->PID_iState = current_unit->PID_dState = 0.0;
-    current_unit->heater_state = current_unit->cooler_state = current_unit->fan_state = 0;
-    current_unit->heater_wait = current_unit->cooler_wait = current_unit->fan_wait = 0;
+    current_unit->PID_cool->OutP = current_unit->PID_heat->OutP = 0.0;
+    current_unit->PID_cool->Mode = current_unit->PID_heat->Mode = PID_MODE_NONE;
+    current_unit->heater_state = current_unit->cooler_state = current_unit->fan_state = current_unit->light_state = 0;
+    current_unit->heater_wait = current_unit->cooler_wait = current_unit->fan_wait = current_unit->light_wait = 0;
     device_out(current_unit->heater_address, current_unit->heater_state);
     device_out(current_unit->cooler_address, current_unit->cooler_state);
     device_out(current_unit->fan_address, current_unit->fan_state);
+    device_out(current_unit->light_address, current_unit->light_state);
     if (current_unit->mode == UNITMODE_PROFILE) {
 	/*
 	 * Set a sane default until it will be overruled by the

mercurial