show scheduler/custom always

This commit is contained in:
MichaelDvP
2023-09-17 09:22:25 +02:00
parent 7310db6426
commit 9d3456cb3a
4 changed files with 36 additions and 34 deletions

View File

@@ -541,19 +541,23 @@ bool Command::device_has_commands(const uint8_t device_type) {
}
if (device_type == EMSdevice::DeviceType::SCHEDULER) {
return EMSESP::webSchedulerService.has_commands();
return true; // we always have info
// return EMSESP::webSchedulerService.has_commands();
}
if (device_type == EMSdevice::DeviceType::CUSTOM) {
return (EMSESP::webEntityService.count_entities() != 0);
return true; // we always have info
// return (EMSESP::webEntityService.count_entities() != 0);
}
if (device_type == EMSdevice::DeviceType::TEMPERATURESENSOR) {
return (EMSESP::temperaturesensor_.have_sensors());
return true; // we always have info
// return (EMSESP::temperaturesensor_.have_sensors());
}
if (device_type == EMSdevice::DeviceType::ANALOGSENSOR) {
return (EMSESP::analogsensor_.have_sensors());
return EMSESP::system_.analog_enabled();
// return (EMSESP::analogsensor_.have_sensors());
}
for (const auto & emsdevice : EMSESP::emsdevices) {
@@ -574,13 +578,13 @@ bool Command::device_has_commands(const uint8_t device_type) {
void Command::show_devices(uuid::console::Shell & shell) {
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SYSTEM));
if (EMSESP::webSchedulerService.has_commands()) {
// if (EMSESP::webSchedulerService.has_commands()) {
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SCHEDULER));
}
if (EMSESP::temperaturesensor_.have_sensors()) {
// }
// if (EMSESP::temperaturesensor_.have_sensors()) {
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::TEMPERATURESENSOR));
}
if (EMSESP::analogsensor_.have_sensors()) {
// }
if (EMSESP::analogsensor_.analog_enabled()) {
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR));
}
@@ -608,7 +612,7 @@ void Command::show_all(uuid::console::Shell & shell) {
show(shell, EMSdevice::DeviceType::SYSTEM, true);
// show Custom
if (EMSESP::webEntityService.has_commands()) {
// if (EMSESP::webEntityService.has_commands()) {
shell.print(COLOR_BOLD_ON);
shell.print(COLOR_YELLOW);
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::CUSTOM));
@@ -618,10 +622,10 @@ void Command::show_all(uuid::console::Shell & shell) {
shell.printf(" commands: %slists all commands %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_RED);
shell.print(COLOR_RESET);
show(shell, EMSdevice::DeviceType::CUSTOM, true);
}
// }
// show scheduler
if (EMSESP::webSchedulerService.has_commands()) {
// if (EMSESP::webSchedulerService.has_commands()) {
shell.print(COLOR_BOLD_ON);
shell.print(COLOR_YELLOW);
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SCHEDULER));
@@ -631,17 +635,17 @@ void Command::show_all(uuid::console::Shell & shell) {
shell.printf(" commands: %slists all commands %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_RED);
shell.print(COLOR_RESET);
show(shell, EMSdevice::DeviceType::SCHEDULER, true);
}
// }
// show sensors
if (EMSESP::temperaturesensor_.have_sensors()) {
// if (EMSESP::temperaturesensor_.have_sensors()) {
shell.print(COLOR_BOLD_ON);
shell.print(COLOR_YELLOW);
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::TEMPERATURESENSOR));
shell.print(COLOR_RESET);
show(shell, EMSdevice::DeviceType::TEMPERATURESENSOR, true);
}
if (EMSESP::analogsensor_.have_sensors()) {
// }
if (EMSESP::analogsensor_.analog_enabled()) {
shell.print(COLOR_BOLD_ON);
shell.print(COLOR_YELLOW);
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR));