From 0c1db756c721021be6f25cf37ad8c2d6f7b94569 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 17 Jul 2024 09:14:39 +0200 Subject: [PATCH] show unknown command in API output so its same as a log --- src/emsesp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 93997a555..18ff6ac2e 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -757,10 +757,11 @@ bool EMSESP::get_device_value_info(JsonObject root, const char * cmd, const int8 } // if the EMS device was valid, but the cmd not found show an error if (found_device) { - // return EMSESP::return_not_found(root, "poep", cmd); // not found + root["message"] = std::string("unknown command ") + cmd; + return false; } - // check for other devices... + // check for other non EMS devices... // temperature sensor if (devicetype == DeviceType::TEMPERATURESENSOR) {