mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-28 17:42:45 +00:00
direct call compute
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include "shuntingYard.h" // for compute() used by the message
|
||||||
#include "EMSESP_Version.h"
|
#include "EMSESP_Version.h"
|
||||||
|
|
||||||
#if defined(EMSESP_TEST)
|
#if defined(EMSESP_TEST)
|
||||||
@@ -222,7 +222,7 @@ bool System::command_message(const char * value, const int8_t id, JsonObject out
|
|||||||
LOG_WARNING("Message is empty");
|
LOG_WARNING("Message is empty");
|
||||||
return false; // must have a string value
|
return false; // must have a string value
|
||||||
}
|
}
|
||||||
std::string computed_value = EMSESP::webSchedulerService.compute_value(value);
|
std::string computed_value = compute(value);
|
||||||
LOG_INFO("Message: %s", computed_value.c_str()); // send to log
|
LOG_INFO("Message: %s", computed_value.c_str()); // send to log
|
||||||
Mqtt::queue_publish(F_(message), computed_value); // send to MQTT if enabled
|
Mqtt::queue_publish(F_(message), computed_value); // send to MQTT if enabled
|
||||||
output["api_data"] = computed_value; // send to API
|
output["api_data"] = computed_value; // send to API
|
||||||
|
|||||||
@@ -472,10 +472,6 @@ void WebSchedulerService::condition() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string WebSchedulerService::compute_value(const char * value) {
|
|
||||||
return compute(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// process any scheduled jobs
|
// process any scheduled jobs
|
||||||
void WebSchedulerService::loop() {
|
void WebSchedulerService::loop() {
|
||||||
// initialize static value on startup
|
// initialize static value on startup
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ class WebSchedulerService : public StatefulService<WebScheduler> {
|
|||||||
bool onChange(const char * cmd);
|
bool onChange(const char * cmd);
|
||||||
|
|
||||||
std::string get_metrics_prometheus();
|
std::string get_metrics_prometheus();
|
||||||
std::string compute_value(const char * value);
|
|
||||||
|
|
||||||
#if defined(EMSESP_TEST)
|
#if defined(EMSESP_TEST)
|
||||||
void load_test_data();
|
void load_test_data();
|
||||||
|
|||||||
Reference in New Issue
Block a user