fixes for device_info

This commit is contained in:
proddy
2024-07-11 16:29:37 +02:00
parent 76675c79fb
commit d7ba360483
12 changed files with 59 additions and 55 deletions

View File

@@ -161,7 +161,11 @@ bool WebSchedulerService::get_value_info(JsonObject output, const char * cmd) {
}
}
return (output.size() > 0);
if (output.size()) {
return true;
}
return EMSESP::return_not_found(output, "scheduler", cmd); // not found
}
char command_s[COMMAND_MAX_LENGTH];
@@ -205,7 +209,7 @@ bool WebSchedulerService::get_value_info(JsonObject output, const char * cmd) {
return true;
}
return false; // not found
return EMSESP::return_not_found(output, "scheduler", cmd); // not found
}
// publish single value
@@ -499,15 +503,6 @@ void WebSchedulerService::test() {
std::string test_cmd = "system/message";
std::string test_value;
test_value = "1+2*3";
EMSESP::logger().warning("Shunting yard test 1: %s = %s", test_value.c_str(), compute(test_value).c_str());
test_value = "system/settings/locale";
EMSESP::logger().warning("Shunting yard test 2: %s = %s", test_value.c_str(), compute(test_value).c_str());
test_value = "hello";
EMSESP::logger().warning("Shunting yard test 3: %s = %s", test_value.c_str(), compute(test_value).c_str());
// should output 'locale is en'
test_value = "\"locale is \"system/settings/locale";
command(test_cmd.c_str(), compute(test_value).c_str());