some fixes for hydroponics mode

This commit is contained in:
Your Name
2021-10-26 20:46:40 +02:00
parent 49664ba6f7
commit 9170a1fe05
5 changed files with 12 additions and 11 deletions

View File

@@ -34,8 +34,8 @@ void Plant::init(void)
{
/* Initialize Home Settings validator */
this->mSetting->pSensorDry->setDefaultValue(DEACTIVATED_PLANT);
this->mSetting->pSensorDry->setValidator([](double candidate) {
return (((candidate >= 0.0) && (candidate <= 100.0)) || equalish(candidate,DEACTIVATED_PLANT));
this->mSetting->pSensorDry->setValidator([](long candidate) {
return (((candidate >= 0.0) && (candidate <= 100.0)) || equalish(candidate,DEACTIVATED_PLANT) || equalish(candidate,HYDROPONIC_MODE));
});
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(8); // start at 8:00
this->mSetting->pPumpAllowedHourRangeStart->setValidator([](long candidate) {

View File

@@ -432,6 +432,7 @@ int determineNextPump(bool isLowLight)
log(LOG_LEVEL_DEBUG, String(String(i) + " Requested pumping"), LOG_DEBUG_CODE);
pumpToUse = i;
return pumpToUse;
}
else
{
@@ -454,7 +455,7 @@ int determineNextPump(bool isLowLight)
consecutiveWateringPlant[i] = 0;
}
}
return pumpToUse;
return -1;
}
/**
@@ -573,6 +574,7 @@ void pumpActiveLoop()
if (!pumpStarted)
{
log(LOG_LEVEL_INFO, "Starting pump " + String(pumpToRun) , LOG_PUMP_STARTED_CODE );
initPumpLogic();
pumpStarted = true;
}
@@ -601,7 +603,7 @@ void pumpActiveLoop()
mPlants[pumpToRun].setProperty("waterusage").send(String(pumped));
}
#else
if (millis() > pumpTarget)
if (millis() > pumpTarget*1000)
{
targetReached = true;
}