Some fixes after field testing
This commit is contained in:
+7
-1
@@ -166,7 +166,7 @@ unsigned long last_pump_switch = 0;
|
||||
void UpdatePump()
|
||||
{
|
||||
unsigned long current = millis();
|
||||
int new_state = 0;
|
||||
int new_state = cur_state;
|
||||
if (cur_mode == MODE_AUTO)
|
||||
{
|
||||
if (cur_p < p_on) new_state = 1;
|
||||
@@ -174,6 +174,12 @@ void UpdatePump()
|
||||
if ((current < last_pump_switch || current - last_pump_switch > PUMP_SWITCH_INTERVAL)
|
||||
&& new_state != cur_state)
|
||||
{
|
||||
Serial.print("CHANGE STATE ");
|
||||
Serial.print(cur_p);
|
||||
Serial.print(" ");
|
||||
Serial.print(p_on);
|
||||
Serial.print(" ");
|
||||
Serial.print(p_off);
|
||||
cur_state = new_state;
|
||||
mb.Hreg(REGISTER_CUR_STATE, cur_state);
|
||||
last_pump_switch = current;
|
||||
|
||||
Reference in New Issue
Block a user