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); |