Setting works with default values

This commit is contained in:
c3ma
2020-10-16 18:25:02 +02:00
parent 4bdb82cecc
commit e95590ffd6
3 changed files with 30 additions and 21 deletions

View File

@@ -23,10 +23,10 @@ private:
int mValue = 0; /**< Value of the moist sensor */
int mAnalogValue=0; /**< moist sensor values, used for a calculation */
HomieNode *mPlant = NULL;
PlantSettings_t mSetting;
HomieNode* mPlant = NULL;
public:
PlantSettings_t* mSetting;
/**
* @brief Construct a new Plant object
@@ -77,12 +77,14 @@ public:
* @return false
*/
bool isPumpRequired() {
return (this->mSetting.pSensorWet != NULL) && (this->mValue < this->mSetting.pSensorWet->get());
return (this->mSetting->pSensorWet != NULL) && (this->mValue < this->mSetting->pSensorWet->get());
}
HomieInternals::SendingPromise& setProperty(const String& property) const {
return mPlant->setProperty(property);
}
void init(void);
};
#endif