add timer only mode, more sane default config

This commit is contained in:
2022-05-20 01:00:04 +02:00
parent 5dedc76727
commit 662d7bc853
5 changed files with 19 additions and 9 deletions

View File

@@ -45,6 +45,8 @@ static const char *SENSOR_STRING[] = {
#define MISSING_SENSOR -2
//plant uses only cooldown and duration, moisture is measured but ignored, allowedHours is ignored (eg. make a 30min on 30min off cycle)
#define HYDROPONIC_MODE -3
//plant uses cooldown and duration and workhours, moisture is measured but ignored
#define TIMER_ONLY -4
typedef struct PlantSettings_t
{

View File

@@ -75,6 +75,12 @@ public:
return SENSOR_STRING[mode];
}
bool isTimerOnly()
{
long current = this->mSetting->pSensorDry->get();
return equalish(current, TIMER_ONLY);
}
bool isHydroponic()
{
long current = this->mSetting->pSensorDry->get();
@@ -94,7 +100,7 @@ public:
*/
bool isPumpRequired()
{
if (isHydroponic())
if (isHydroponic() || isTimerOnly())
{
// hydroponic only uses timer based controll
return true;