diff --git a/esp32/include/HomieConfiguration.h b/esp32/include/HomieConfiguration.h index d6a4d07..124d166 100644 --- a/esp32/include/HomieConfiguration.h +++ b/esp32/include/HomieConfiguration.h @@ -24,7 +24,7 @@ * @{ **/ -#define NUMBER_TYPE "Number" /**< numberic information, published or read in Homie */ +#define NUMBER_TYPE "Float" /**< numberic information, published or read in Homie */ /** * @name Temperatur Node diff --git a/esp32/platformio.ini b/esp32/platformio.ini index 110308f..c6aac22 100644 --- a/esp32/platformio.ini +++ b/esp32/platformio.ini @@ -12,7 +12,7 @@ platform = espressif32 board = esp32doit-devkit-v1 framework = arduino -build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -fexceptions -lstdc++-exc +build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY board_build.partitions = defaultWithSmallerSpiffs.csv diff --git a/esp32/src/PlantCtrl.cpp b/esp32/src/PlantCtrl.cpp index 5a1808d..c2c2340 100644 --- a/esp32/src/PlantCtrl.cpp +++ b/esp32/src/PlantCtrl.cpp @@ -202,9 +202,9 @@ void Plant::setSwitchHandler(HomieInternals::PropertyInputHandler f) { void Plant::advertise(void) { // Advertise topics - mPump = this->mPlant->advertise("switch").setName("Pump").setDatatype("boolean"); - this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Number").setUnit("unixtime"); - this->mPlant->advertise("moist").setName("Percent").setDatatype("Number").setUnit("%"); - this->mPlant->advertise("moistraw").setName("adc").setDatatype("Number").setUnit("3.3/4096V"); - this->mPlant->advertise("state").setName("state").setDatatype("string"); + 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"); } diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 9565308..823d8f2 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -660,7 +660,6 @@ void pumpActiveLoop() void safeSetup() { - //throw std::runtime_error("Shit happened"); /* reduce power consumption */ setCpuFrequencyMhz(80);