From 9167da5a8205898109107506ba2400f6deb9ad07 Mon Sep 17 00:00:00 2001 From: Ollo Date: Tue, 20 Jun 2023 18:06:29 +0200 Subject: [PATCH] Refactoring --- esp32/src/PlantCtrl.cpp | 4 ++-- esp32/src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esp32/src/PlantCtrl.cpp b/esp32/src/PlantCtrl.cpp index bbd2bf7..b1fb49c 100644 --- a/esp32/src/PlantCtrl.cpp +++ b/esp32/src/PlantCtrl.cpp @@ -230,8 +230,8 @@ void Plant::activatePump(void) ledcWrite(this->mPlantId, desiredPowerLevelPercent * PWM_BITS); if (this->mConnected) { - const String OFF = String("ON"); - this->mPlant->setProperty("switch").send(OFF); + const String ON = String("ON"); + this->mPlant->setProperty("switch").send(ON); this->mPlant->setProperty("lastPump").send(String(getCurrentTime())); } } diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 900d804..817cf9c 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -704,7 +704,7 @@ void pumpActiveLoop() } bool mqttUpdateTick = false; - if (lastSendPumpUpdate + 1000 < millis()) + if (lastSendPumpUpdate + 3000 < millis()) { lastSendPumpUpdate = millis(); mqttUpdateTick = true;