thermferm/server.c

changeset 189
cc2b04d4db99
parent 185
4f34271cf1e7
child 191
c74bbc24a1c8
equal deleted inserted replaced
188:4fc17ef4593f 189:cc2b04d4db99
1228 unit->door_address = NULL; 1228 unit->door_address = NULL;
1229 1229
1230 } else if (val && (strcmp(kwd, (char *)"MODE") == 0)) { 1230 } else if (val && (strcmp(kwd, (char *)"MODE") == 0)) {
1231 for (i = 0; i < 5; i++) { 1231 for (i = 0; i < 5; i++) {
1232 if (strcmp(val, UNITMODE[i]) == 0) { 1232 if (strcmp(val, UNITMODE[i]) == 0) {
1233 /* Initialize log if the unit is turned on */
1234 if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF))
1235 initlog(unit->name);
1233 unit->mode = i; 1236 unit->mode = i;
1234 /* Allways turn everything off after a mode change */ 1237 /* Allways turn everything off after a mode change */
1235 unit->heater_state = unit->cooler_state = unit->fan_state = 0; 1238 unit->heater_state = unit->cooler_state = unit->fan_state = 0;
1236 device_out(unit->heater_address, unit->heater_state); 1239 device_out(unit->heater_address, unit->heater_state);
1237 device_out(unit->cooler_address, unit->cooler_state); 1240 device_out(unit->cooler_address, unit->cooler_state);

mercurial