diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index f762777ca..1b6f99537 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -20,6 +20,7 @@ For more details go to [emsesp.org](https://emsesp.org/). - start scheduler after customEntities, delay scheduler loop after startup, handling of `system/restart` command [#3146](https://github.com/emsesp/EMS-ESP32/issues/3146) - possible memory leaks fixed. - repeated startup schedules compute value +- call `system/message` called from scheduler processes compute twice ## Changed diff --git a/src/core/shuntingYard.cpp b/src/core/shuntingYard.cpp index aacf23ead..73012d44e 100644 --- a/src/core/shuntingYard.cpp +++ b/src/core/shuntingYard.cpp @@ -39,17 +39,8 @@ std::deque exprToTokens(const std::string & expr) { i += (*p == '{') ? 1 : (*p == '}') ? -1 : 0; ++p; } - if (*p) { - ++p; - } - // Use string_view to avoid unnecessary string copies - std::string_view s(b, p - b); - auto n = s.find("\"\""); - while (n != std::string_view::npos) { - s.remove_prefix(n + 2); - n = s.find("\"\""); - } - tokens.emplace_back(Token::Type::String, std::string(s), -3); + const auto s = std::string(b, p); + tokens.emplace_back(Token::Type::String, s, -3); if (*p == '\0') { --p; } diff --git a/src/emsesp_version.h b/src/emsesp_version.h index fe1387c14..085e05d4b 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.8.3-dev.8e" +#define EMSESP_APP_VERSION "3.8.3-dev.8f" diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index b66d0f6ab..d18d5d8de 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -347,7 +347,11 @@ uint8_t WebSchedulerService::count_entities(bool cmd_only) { // execute scheduled command bool WebSchedulerService::command(const char * name, const std::string & command, const std::string & data) { std::string cmd = Helpers::toLower(command); - + if (cmd == "system/message") { + EMSESP::logger().info("Message: %s", data.c_str()); // send to log + Mqtt::queue_publish(F_(message), data); // send to MQTT if enabled + return true; + } // check http commands. e.g. // tasmota(get): http:///cm?cmnd=power%20ON // shelly(get): http:///relais/0?turn=on