add message "no entries" to analog/temperature/custom/sccheduler

This commit is contained in:
MichaelDvP
2023-09-18 16:21:58 +02:00
parent 09e2945c15
commit a6b0c74f5f
4 changed files with 15 additions and 11 deletions

View File

@@ -625,6 +625,7 @@ 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 false;
}
// make a copy of the string command for parsing
@@ -686,7 +687,8 @@ bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const i
// returns false if there are no sensors
bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject & output) const {
if (sensors_.empty()) {
return false;
output["message"] = "no entries";
return true;
}
for (const auto & sensor : sensors_) {