From 43e638a587da799cda3b316cd8a87a09769ecaba Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 20 Dec 2022 00:07:10 +0100 Subject: [PATCH] set more state retained --- esp32/src/PlantCtrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/src/PlantCtrl.cpp b/esp32/src/PlantCtrl.cpp index 246d880..a01f847 100644 --- a/esp32/src/PlantCtrl.cpp +++ b/esp32/src/PlantCtrl.cpp @@ -264,9 +264,9 @@ void Plant::advertise(void) { // Advertise topics mPump = this->mPlant->advertise("switch").setName("Pump").setDatatype("Boolean"); - this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Integer").setUnit("unixtime"); - this->mPlant->advertise("moist").setName("Percent").setDatatype("Float").setUnit("%"); - this->mPlant->advertise("moistraw").setName("adc").setDatatype("Float").setUnit("3.3/4096V"); - this->mPlant->advertise("state").setName("state").setDatatype("String"); + this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Integer").setUnit("unixtime").setRetained(true); + this->mPlant->advertise("moist").setName("Percent").setDatatype("Float").setUnit("%").setRetained(true); + this->mPlant->advertise("moistraw").setName("adc").setDatatype("Float").setUnit("3.3/4096V").setRetained(true); + this->mPlant->advertise("state").setName("state").setDatatype("String").setRetained(true); }