mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
upload progress changes
This commit is contained in:
@@ -370,9 +370,9 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
||||
// report back. If not OK show output from error, other return the HTTP code
|
||||
if (return_code != CommandRet::OK) {
|
||||
if ((value == nullptr) || (strlen(value) == 0)) {
|
||||
LOG_ERROR("Command '%s' failed with code: %d", cmd, return_code);
|
||||
LOG_ERROR("Command '%s' failed with error code %d", cmd, return_code);
|
||||
} else {
|
||||
LOG_ERROR("Command '%s/%s' failed with code: %d", cmd, value, return_code);
|
||||
LOG_ERROR("Command '%s/%s' failed with error code %d", cmd, value, return_code);
|
||||
}
|
||||
return message(return_code, "callback function failed", output);
|
||||
}
|
||||
|
||||
@@ -1755,7 +1755,7 @@ void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
// data: displaycode(2), errornumber(2), year, month, hour, day, minute, duration(2), src-addr
|
||||
static uint32_t lastCodeDate_ = 0; // last code date
|
||||
char code[3] = {telegram->message_data[0], telegram->message_data[1], 0};
|
||||
uint8_t code[3] = {telegram->message_data[0], telegram->message_data[1], 0};
|
||||
uint16_t codeNo = telegram->message_data[2] * 256 + telegram->message_data[3];
|
||||
uint16_t year = (telegram->message_data[4] & 0x7F) + 2000;
|
||||
uint8_t month = telegram->message_data[5];
|
||||
|
||||
@@ -287,11 +287,11 @@ void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) {
|
||||
if (output.size()) {
|
||||
snprintf(error,
|
||||
sizeof(error),
|
||||
"MQTT command failed with error: %s (%s)",
|
||||
"MQTT command failed with error %s (%s)",
|
||||
(const char *)output["message"],
|
||||
Command::return_code_string(return_code).c_str());
|
||||
} else {
|
||||
snprintf(error, sizeof(error), "MQTT command failed with error code (%s)", Command::return_code_string(return_code).c_str());
|
||||
snprintf(error, sizeof(error), "MQTT command failed with error %s", Command::return_code_string(return_code).c_str());
|
||||
}
|
||||
LOG_ERROR(error);
|
||||
Mqtt::queue_publish("response", error);
|
||||
|
||||
@@ -128,9 +128,9 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) {
|
||||
if (return_code != CommandRet::OK) {
|
||||
char error[100];
|
||||
if (output.size()) {
|
||||
snprintf(error, sizeof(error), "API failed with error: %s (%s)", (const char *)output["message"], Command::return_code_string(return_code).c_str());
|
||||
snprintf(error, sizeof(error), "API failed with error %s (%s)", (const char *)output["message"], Command::return_code_string(return_code).c_str());
|
||||
} else {
|
||||
snprintf(error, sizeof(error), "API failed with error code (%s)", Command::return_code_string(return_code).c_str());
|
||||
snprintf(error, sizeof(error), "API failed with error %s", Command::return_code_string(return_code).c_str());
|
||||
}
|
||||
emsesp::EMSESP::logger().err(error);
|
||||
api_fails_++;
|
||||
|
||||
@@ -363,7 +363,7 @@ bool WebSchedulerService::command(const char * cmd, const char * data) {
|
||||
(const char *)output["message"],
|
||||
Command::return_code_string(return_code).c_str());
|
||||
} else {
|
||||
snprintf(error, sizeof(error), "Scheduled command %s failed with error code (%s)", cmd, Command::return_code_string(return_code).c_str());
|
||||
snprintf(error, sizeof(error), "Scheduled command %s failed with error %s", cmd, Command::return_code_string(return_code).c_str());
|
||||
}
|
||||
|
||||
emsesp::EMSESP::logger().warning(error);
|
||||
|
||||
Reference in New Issue
Block a user