From 505aa1f94590b644ded4d5c4fb639380fef32a4e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 29 Sep 2024 09:00:05 +0200 Subject: [PATCH] fix using NUMOP_MUL50 on webUI #2064, dev41 --- CHANGELOG_LATEST.md | 5 +++++ src/helpers.cpp | 31 ++++++------------------------- src/version.h | 2 +- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 6285bbc06..e2184d1e8 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -49,6 +49,8 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/). - log shows data for F7/F9 requests - Detection of LittleFS for factory setting wasn't working - Check for bad GPIOs with Ethernet before the ethernet is initialized +- Show values with factor 50 on webUI [#2064](https://github.com/emsesp/EMS-ESP32/issues/2064) +- Rendering of values between -1 and 0 ## Changed @@ -70,3 +72,6 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/). - WebLog UI matches color schema of the terminal console correctly - Updated Web libraries, ArduinoJson - Help page doesn't show detailed tech info if the user is not 'admin' role [#2054](https://github.com/emsesp/EMS-ESP32/issues/2054) +- Show ems-esp internal devices in device list of system/info +- Scheduler and mqtt run async on systems with psram +- Show IPv6 address type (local/global/ula) in log diff --git a/src/helpers.cpp b/src/helpers.cpp index ec76c182b..508f1819c 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -460,31 +460,12 @@ int Helpers::atoint(const char * value) { float Helpers::transformNumFloat(float value, const int8_t numeric_operator, const uint8_t fahrenheit) { float val; - switch (numeric_operator) { - case DeviceValueNumOp::DV_NUMOP_DIV2: - val = (value * 100 / 2 + 0.5); - break; - case DeviceValueNumOp::DV_NUMOP_DIV10: - val = (value * 10 + 0.5); - break; - case DeviceValueNumOp::DV_NUMOP_DIV60: - val = (value * 10 / 6 + 0.5); - break; - case DeviceValueNumOp::DV_NUMOP_DIV100: - val = (value + 0.5); - break; - case DeviceValueNumOp::DV_NUMOP_MUL5: - val = value * 100 * 5; - break; - case DeviceValueNumOp::DV_NUMOP_MUL10: - val = value * 100 * 10; - break; - case DeviceValueNumOp::DV_NUMOP_MUL15: - val = value * 100 * 15; - break; - default: - val = (value * 100 + 0.5); // no ops - break; + if (numeric_operator == 0) { // DV_NUMOP_NONE + val = value * 100 + 0.5; + } else if (numeric_operator > 0) { // DV_NUMOP_DIVxx + val = value * 100 / numeric_operator + 0.5; + } else { // DV_NUMOP_MULxx + val = value * -100 * numeric_operator; } if (value < 0) { // negative rounding diff --git a/src/version.h b/src/version.h index f18b9395f..b78c093ae 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.40" +#define EMSESP_APP_VERSION "3.7.0-dev.41"