thermferm/server.c

changeset 189
cc2b04d4db99
parent 185
4f34271cf1e7
child 191
c74bbc24a1c8
--- a/thermferm/server.c	Tue Aug 05 22:50:33 2014 +0200
+++ b/thermferm/server.c	Thu Aug 07 14:20:11 2014 +0200
@@ -1230,6 +1230,9 @@
 			    } else if (val && (strcmp(kwd, (char *)"MODE") == 0)) {
 				for (i = 0; i < 5; i++) {
 				    if (strcmp(val, UNITMODE[i]) == 0) {
+					/* Initialize log if the unit is turned on */
+					if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF))
+					    initlog(unit->name);
 					unit->mode = i;
 					/* Allways turn everything off after a mode change */
 					unit->heater_state = unit->cooler_state = unit->fan_state = 0;

mercurial