mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
@@ -286,7 +286,7 @@ const char * Command::parse_command_string(const char * command, int8_t & id) {
|
|||||||
|
|
||||||
// check if command contains an attribute
|
// check if command contains an attribute
|
||||||
const char * Command::get_attribute(const char * cmd) {
|
const char * Command::get_attribute(const char * cmd) {
|
||||||
char * breakp = strchr(cmd, '/');
|
char * breakp = (char *)strchr(cmd, '/');
|
||||||
if (breakp) {
|
if (breakp) {
|
||||||
*breakp = '\0';
|
*breakp = '\0';
|
||||||
return breakp + 1;
|
return breakp + 1;
|
||||||
|
|||||||
@@ -1315,7 +1315,7 @@ bool System::get_value_info(JsonObject output, const char * cmd) {
|
|||||||
if (p.value().is<JsonObject>()) {
|
if (p.value().is<JsonObject>()) {
|
||||||
// String prefix = p.key().c_str();
|
// String prefix = p.key().c_str();
|
||||||
for (JsonPair p1 : p.value().as<JsonObject>()) {
|
for (JsonPair p1 : p.value().as<JsonObject>()) {
|
||||||
JsonObject entity = output[String(p.key().c_str()) + '.' + p1.key().c_str()].to<JsonObject>();
|
JsonObject entity = output[std::string(p.key().c_str()) + "." + p1.key().c_str()].to<JsonObject>();
|
||||||
get_value_json(entity, p.key().c_str(), p1.key().c_str(), p1.value());
|
get_value_json(entity, p.key().c_str(), p1.key().c_str(), p1.value());
|
||||||
}
|
}
|
||||||
} // else { // we don't have pairs in json root object
|
} // else { // we don't have pairs in json root object
|
||||||
@@ -1325,12 +1325,12 @@ bool System::get_value_info(JsonObject output, const char * cmd) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * val = strstr(cmd, "/value");
|
char * val = (char *)strstr(cmd, "/value");
|
||||||
if (val) {
|
if (val) {
|
||||||
*val = '\0';
|
*val = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
char * slash = strchr(cmd, '/');
|
char * slash = (char *)strchr(cmd, '/');
|
||||||
if (slash) {
|
if (slash) {
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
slash++;
|
slash++;
|
||||||
|
|||||||
Reference in New Issue
Block a user