|
@@ -115,6 +115,8 @@ static const char *state_names[] = {
|
115
|
115
|
stringify(error)
|
116
|
116
|
};
|
117
|
117
|
|
|
118
|
+static int auto_pump_runtime[PUMP_COUNT] = AUTO_PUMP_RUNTIME;
|
|
119
|
+
|
118
|
120
|
const char *Statemachine::getStateName(void) {
|
119
|
121
|
return state_names[state];
|
120
|
122
|
}
|
|
@@ -290,12 +292,13 @@ void Statemachine::input(int n) {
|
290
|
292
|
switch_to((state == auto_mode_a) ? auto_mode_b : auto_mode_a);
|
291
|
293
|
}
|
292
|
294
|
} else if ((state == auto_fert_a) || (state == auto_fert_b)) {
|
|
295
|
+ // TODO fertilizer number currently "hardcoded" to 3 in UI
|
293
|
296
|
if ((n >= 1) && (n <= 3)) {
|
294
|
297
|
auto wl = plants.getWaterlevel();
|
295
|
298
|
if ((wl != Plants::full) && (wl != Plants::invalid)) {
|
296
|
299
|
plants.startFertilizer(n - 1);
|
297
|
300
|
selected_id = n;
|
298
|
|
- selected_time = AUTO_PUMP_RUNTIME;
|
|
301
|
+ selected_time = auto_pump_runtime[n - 1];
|
299
|
302
|
start_time = millis();
|
300
|
303
|
switch_to(auto_fert_run);
|
301
|
304
|
} else if (wl == Plants::full) {
|