missing sensor detection, delta trigger moisture working

This commit is contained in:
2020-11-04 23:28:08 +01:00
parent 1dcf4df740
commit a14f599f5a
6 changed files with 137 additions and 20 deletions
+9 -4
View File
@@ -48,8 +48,6 @@ public:
*/
void addSenseValue(void);
int getSensorValue() { return moistureRaw.getMedian(); }
void deactivatePump(void);
void activatePump(void);
@@ -73,7 +71,10 @@ public:
}
float getCurrentMoisture()
{
{
if(moistureRaw.getCount()==0){
return MISSING_SENSOR;
}
return this->moistureRaw.getMedian();
}
long getSettingsMoisture()
@@ -108,7 +109,11 @@ public:
return false;
}
return (this->mSetting->pPumpCooldownInHours->get() > sinceLastActivation / 3600);
return (getCooldownInSeconds() > sinceLastActivation);
}
long getCooldownInSeconds(){
return this->mSetting->pPumpCooldownInHours->get()*60*60;
}
bool isAllowedOnlyAtLowLight(void)