fix unknown command being added to return json

This commit is contained in:
proddy
2024-07-21 12:59:19 +02:00
parent 006b38df27
commit 2a9ebde829

View File

@@ -743,7 +743,7 @@ void EMSESP::publish_response(std::shared_ptr<const Telegram> telegram) {
}
// builds json with the detail of each value, for a given EMS device
// for other types like sensors, scheduler, custom entities it will process single commands like 'info', 'values', 'commands'...
// for other types like sensors, scheduler, custom entities it will process single commands like 'info', 'values', 'commands', 'entities'...
bool EMSESP::get_device_value_info(JsonObject root, const char * cmd, const int8_t id, const uint8_t devicetype) {
// check first for EMS devices
bool found_device = false;
@@ -755,9 +755,8 @@ 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 the EMS device was valid, but the cmd not found exit. it will be handled upstream.
if (found_device) {
root["message"] = std::string("unknown command ") + cmd;
return false;
}