Read settings and store into non volatile memory

This commit is contained in:
c3ma
2020-10-16 21:12:25 +02:00
parent 6cf9771dcb
commit b9ca98904d
4 changed files with 76 additions and 10 deletions

View File

@@ -13,6 +13,8 @@
#include <Homie.h>
#define DEACTIVATED_PLANT 5000
typedef struct PlantSettings_t {
HomieSetting<long>* pSensorDry;
HomieSetting<long>* pSensorWet;

View File

@@ -24,9 +24,9 @@ private:
int mAnalogValue=0; /**< moist sensor values, used for a calculation */
HomieNode* mPlant = NULL;
PlantSettings_t* mSetting;
public:
PlantSettings_t* mSetting;
/**
* @brief Construct a new Plant object
@@ -85,6 +85,10 @@ public:
}
void init(void);
long getSettingSensorDry() {
return this->mSetting->pSensorDry->get();
}
};
#endif