Disable pumps while OTA running, mode2 is called only once
This commit is contained in:
parent
0bd4aae258
commit
a140383e32
@ -60,7 +60,9 @@ public:
|
|||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
bool isPumpRequired() {
|
bool isPumpRequired() {
|
||||||
return (this->mSetting->pSensorDry != NULL) && (this->moistureRaw.getMedian() < this->mSetting->pSensorDry->get());
|
return (this->mSetting->pSensorDry != NULL)
|
||||||
|
&& (this->moistureRaw.getMedian() > this->mSetting->pSensorDry->get())
|
||||||
|
&& (this->mSetting->pSensorDry->get() != DEACTIVATED_PLANT);
|
||||||
}
|
}
|
||||||
|
|
||||||
HomieInternals::SendingPromise& setProperty(const String& property) const {
|
HomieInternals::SendingPromise& setProperty(const String& property) const {
|
||||||
|
@ -21,7 +21,7 @@ Plant::Plant(int pinSensor, int pinPump,int plantId, HomieNode* plant, PlantSett
|
|||||||
|
|
||||||
void Plant::init(void) {
|
void Plant::init(void) {
|
||||||
/* Initialize Home Settings validator */
|
/* Initialize Home Settings validator */
|
||||||
this->mSetting->pSensorDry->setDefaultValue(4095);
|
this->mSetting->pSensorDry->setDefaultValue(DEACTIVATED_PLANT);
|
||||||
this->mSetting->pSensorDry->setValidator([] (long candidate) {
|
this->mSetting->pSensorDry->setValidator([] (long candidate) {
|
||||||
return (((candidate >= 0) && (candidate <= 4095) ) || candidate == DEACTIVATED_PLANT);
|
return (((candidate >= 0) && (candidate <= 4095) ) || candidate == DEACTIVATED_PLANT);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user