don't show commands for a device if it doesn't have any

This commit is contained in:
proddy
2020-10-25 18:30:23 +01:00
parent 3b99a58953
commit d2a1d65ca2

View File

@@ -146,7 +146,7 @@ void Command::show_devices(uuid::console::Shell & shell) {
for (const auto & device_class : EMSFactory::device_handlers()) { for (const auto & device_class : EMSFactory::device_handlers()) {
for (const auto & emsdevice : EMSESP::emsdevices) { for (const auto & emsdevice : EMSESP::emsdevices) {
if ((emsdevice) && (emsdevice->device_type() == device_class.first)) { if ((emsdevice) && (emsdevice->device_type() == device_class.first) && (device_has_commands(device_class.first))) {
shell.printf("%s ", EMSdevice::device_type_2_device_name(device_class.first).c_str()); shell.printf("%s ", EMSdevice::device_type_2_device_name(device_class.first).c_str());
break; // we only want to show one (not multiple of the same device types) break; // we only want to show one (not multiple of the same device types)
} }