cleanup, adapt comments, packages

This commit is contained in:
MichaelDvP
2023-09-20 17:56:39 +02:00
parent 5c484d58dc
commit dcdd8d9e44
6 changed files with 9 additions and 15 deletions

View File

@@ -625,7 +625,6 @@ void AnalogSensor::publish_values(const bool force) {
// searches by name
bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) const {
if (sensors_.empty()) {
// output["message"] = "no entries";
return true;
}
// make a copy of the string command for parsing
@@ -684,10 +683,9 @@ bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const i
}
// creates JSON doc from values
// returns false if there are no sensors
// returns true if there are no sensors
bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject & output) const {
if (sensors_.empty()) {
// output["message"] = "no entries";
return true;
}

View File

@@ -360,10 +360,9 @@ bool TemperatureSensor::command_commands(const char * value, const int8_t id, Js
}
// creates JSON doc from values
// returns false if there are no sensors
// returns true if there are no sensors
bool TemperatureSensor::command_info(const char * value, const int8_t id, JsonObject & output) {
if (sensors_.empty()) {
// output["message"] = "no entries";
return true;
}
@@ -390,7 +389,6 @@ bool TemperatureSensor::command_info(const char * value, const int8_t id, JsonOb
// called from emsesp.cpp, similar to the emsdevice->get_value_info
bool TemperatureSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) {
if (sensors_.empty()) {
// output["message"] = "no entries";
return true;
}
// make a copy of the string command for parsing

View File

@@ -247,10 +247,9 @@ bool WebCustomEntityService::get_value_info(JsonObject & output, const char * cm
}
return true;
}
// if no entries, return a message instead of an error
// if no entries, return empty json
// https://github.com/emsesp/EMS-ESP32/issues/1297
if (customEntityItems->size() == 0) {
// output["message"] = "no entries";
return true;
}
if (strlen(cmd) == 0 || Helpers::toLower(cmd) == F_(values) || Helpers::toLower(cmd) == F_(info)) {

View File

@@ -144,7 +144,6 @@ bool WebSchedulerService::get_value_info(JsonObject & output, const char * cmd)
return true;
}
if (scheduleItems->size() == 0) {
// output["message"] = "no entries";
return true;
}
if (strlen(cmd) == 0 || Helpers::toLower(cmd) == F_(values) || Helpers::toLower(cmd) == F_(info)) {