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

@@ -142,6 +142,10 @@ 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)) {
// list all names
for (const ScheduleItem & scheduleItem : *scheduleItems) {
@@ -158,10 +162,6 @@ bool WebSchedulerService::get_value_info(JsonObject & output, const char * cmd)
}
return (output.size() > 0);
}
if (scheduleItems->size() == 0) {
output["message"] = "no schedules";
return false;
}
char command_s[30];
strlcpy(command_s, cmd, sizeof(command_s));
char * attribute_s = nullptr;