Merge branch 'master' of github.com:0110/PlantCtrl

This commit is contained in:
Empire
2023-02-10 22:12:57 +01:00
6 changed files with 89 additions and 65 deletions

View File

@@ -94,7 +94,7 @@
#define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin)
#define ANALOG_SENSOR_MAX_MV 1300 //successive approximation of good range
#define ANALOG_SENSOR_MIN_MV 300 //successive approximation of good range
#define ANALOG_SENSOR_MIN_MV 100 //successive approximation of good range
#define SOLAR_VOLT_FACTOR 11
#define BATTSENSOR_INDEX_SOLAR 0

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

@@ -29,6 +29,9 @@
#define LOG_PUMP_AND_DOWNLOADMODE "Download mode, ignoring pump request"
#define LOG_PUMP_AND_DOWNLOADMODE_CODE 2
#define LOG_VERY_COLD_WATER "Water potentially frozen, ignoring pump request"
#define LOG_VERY_COLD_WATER -7
//msg is dynamic defined
#define LOG_PUMP_INEFFECTIVE -4
#define LOG_PUMP_STARTED_CODE 10

View File

@@ -73,6 +73,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();
@@ -92,7 +98,7 @@ public:
*/
bool isPumpRequired()
{
if (isHydroponic())
if (isHydroponic() || isTimerOnly())
{
// hydroponic only uses timer based controll
return true;