show attribute in log message

This commit is contained in:
proddy
2024-07-23 18:54:17 +02:00
parent 49ca42d683
commit 0d0d0aa111
4 changed files with 4 additions and 7 deletions

View File

@@ -705,7 +705,7 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
output["api_data"] = data; // always as a string output["api_data"] = data; // always as a string
return true; return true;
} }
return EMSESP::return_not_found(output, "attribute", sensor_name); // not found return EMSESP::return_not_found(output, attribute_s, sensor_name); // not found
} }
return true; // found a match, exit return true; // found a match, exit
} }

View File

@@ -1598,16 +1598,13 @@ bool EMSdevice::get_value_info(JsonObject output, const char * cmd, const int8_t
// if we're filtering on an attribute, go find it // if we're filtering on an attribute, go find it
if (attribute_s) { if (attribute_s) {
#if defined(EMSESP_DEBUG)
EMSESP::logger().debug("[DEBUG] fetching single attribute %s", attribute_s);
#endif
if (json.containsKey(attribute_s)) { if (json.containsKey(attribute_s)) {
std::string data = json[attribute_s].as<std::string>(); std::string data = json[attribute_s].as<std::string>();
output.clear(); output.clear();
output["api_data"] = data; // always as string output["api_data"] = data; // always as string
return true; return true;
} }
return EMSESP::return_not_found(output, "attribute", command_s); // not found return EMSESP::return_not_found(output, attribute_s, command_s); // not found
} }
return true; return true;

View File

@@ -402,7 +402,7 @@ bool TemperatureSensor::get_value_info(JsonObject output, const char * cmd, cons
output["api_data"] = data; // always as string output["api_data"] = data; // always as string
return true; return true;
} }
return EMSESP::return_not_found(output, "attribute", sensor_name); // not found return EMSESP::return_not_found(output, attribute_s, sensor_name); // not found
} }
return true; // found a match, exit return true; // found a match, exit
} }

View File

@@ -325,7 +325,7 @@ bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd)
output["api_data"] = data; // always as string output["api_data"] = data; // always as string
return true; return true;
} }
return EMSESP::return_not_found(output, "attribute", command_s); // not found return EMSESP::return_not_found(output, attribute_s, command_s); // not found
} }
} }