Configuration can be used with default values

This commit is contained in:
c3ma
2020-10-16 18:40:39 +02:00
parent e95590ffd6
commit 8458912962
3 changed files with 19 additions and 13 deletions

View File

@@ -28,16 +28,16 @@ void Plant::init(void) {
this->mSetting->pSensorWet->setValidator([] (long candidate) {
return ((candidate >= 0) && (candidate <= 4095) );
});
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(8);
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(8); // start at 8:00
this->mSetting->pPumpAllowedHourRangeStart->setValidator([] (long candidate) {
return ((candidate >= 0) && (candidate <= 23) );
});
this->mSetting->pPumpAllowedHourRangeEnd->setDefaultValue(20);
this->mSetting->pPumpAllowedHourRangeEnd->setDefaultValue(20); // stop pumps at 20:00
this->mSetting->pPumpAllowedHourRangeEnd->setValidator([] (long candidate) {
return ((candidate >= 0) && (candidate <= 23) );
});
this->mSetting->pPumpOnlyWhenLowLight->setDefaultValue(true);
this->mSetting->pPumpCooldownInHours->setDefaultValue(20);
this->mSetting->pPumpCooldownInHours->setDefaultValue(20); // minutes
this->mSetting->pPumpCooldownInHours->setValidator([] (long candidate) {
return ((candidate >= 0) && (candidate <= 1024) );
});