From 4bdb82cecc0f499adbe76868f42a8a64353b603b Mon Sep 17 00:00:00 2001 From: c3ma Date: Fri, 16 Oct 2020 16:47:36 +0200 Subject: [PATCH] uniq setting names --- esp32/include/HomieConfiguration.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/esp32/include/HomieConfiguration.h b/esp32/include/HomieConfiguration.h index ac5d6cb..da632c2 100644 --- a/esp32/include/HomieConfiguration.h +++ b/esp32/include/HomieConfiguration.h @@ -49,22 +49,22 @@ HomieSetting waterLevelVol("waterVolume", "ml between minimum and maximum" /** Plant specific ones */ -#define GENERATE_PLANT(plant) \ - HomieSetting mSensorDry##plant = HomieSetting("moistdry##plant", "Moist sensor dry threshold"); \ - HomieSetting mSensorWet##plant = HomieSetting("moistwet##plant", "Moist sensor wet threshold"); \ - HomieSetting mPumpAllowedHourRangeStart##plant = HomieSetting("rangehourstart##plant", "Range pump allowed hour start"); \ - HomieSetting mPumpAllowedHourRangeEnd##plant = HomieSetting("rangehourend##plant", "Range pump allowed hour end"); \ - HomieSetting mPumpOnlyWhenLowLight##plant = HomieSetting("onlyWhenLowLightZ##plant", "Enable the Pump only, when there is light but not enought to charge battery"); \ - HomieSetting mPumpCooldownInHours##plant = HomieSetting("cooldownpump##plant", "How long to wait until the pump is activated again"); \ +#define GENERATE_PLANT(plant, strplant) \ + HomieSetting mSensorDry##plant = HomieSetting("moistdry" strplant, "Plant " strplant "- Moist sensor dry threshold"); \ + HomieSetting mSensorWet##plant = HomieSetting("moistwet" strplant, "Plant" strplant " - Moist sensor wet threshold"); \ + HomieSetting mPumpAllowedHourRangeStart##plant = HomieSetting("rangehourstart" strplant, "Plant" strplant " - Range pump allowed hour start"); \ + HomieSetting mPumpAllowedHourRangeEnd##plant = HomieSetting("rangehourend" strplant, "Plant" strplant " - Range pump allowed hour end"); \ + HomieSetting mPumpOnlyWhenLowLight##plant = HomieSetting("onlyWhenLowLightZ" strplant, "Plant" strplant " - Enable the Pump only, when there is light but not enought to charge battery"); \ + HomieSetting mPumpCooldownInHours##plant = HomieSetting("cooldownpump" strplant, "Plant" strplant " - How long to wait until the pump is activated again"); \ PlantSettings_t mSetting##plant = { &mSensorDry##plant, &mSensorWet##plant, &mPumpAllowedHourRangeStart##plant, &mPumpAllowedHourRangeEnd##plant, &mPumpOnlyWhenLowLight##plant, &mPumpCooldownInHours##plant }; -GENERATE_PLANT(0); -GENERATE_PLANT(1); -GENERATE_PLANT(2); -GENERATE_PLANT(3); -GENERATE_PLANT(4); -GENERATE_PLANT(5); -GENERATE_PLANT(6); +GENERATE_PLANT(0, "0"); +GENERATE_PLANT(1, "1"); +GENERATE_PLANT(2, "2"); +GENERATE_PLANT(3, "3"); +GENERATE_PLANT(4, "4"); +GENERATE_PLANT(5, "5"); +GENERATE_PLANT(6, "6");