Fixed OTA problems, Clock Alerts and MQTT Logs. V151
This commit is contained in:
@@ -1249,6 +1249,8 @@ void CommandHandler::handleCustomUpdateCommand(JsonVariant contents, const Messa
|
||||
contents["checksum"].as<String>() : "";
|
||||
size_t fileSize = contents.containsKey("file_size") ?
|
||||
contents["file_size"].as<size_t>() : 0;
|
||||
uint16_t version = contents.containsKey("version") ?
|
||||
contents["version"].as<uint16_t>() : 0;
|
||||
|
||||
// Check if player is active
|
||||
if (_player && _player->isCurrentlyPlaying()) {
|
||||
@@ -1257,10 +1259,11 @@ void CommandHandler::handleCustomUpdateCommand(JsonVariant contents, const Messa
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO("Custom update: URL=%s, Checksum=%s, Size=%u",
|
||||
LOG_INFO("Custom update: URL=%s, Checksum=%s, Size=%u, Version=%u",
|
||||
firmwareUrl.c_str(),
|
||||
checksum.isEmpty() ? "none" : checksum.c_str(),
|
||||
fileSize);
|
||||
fileSize,
|
||||
version);
|
||||
|
||||
sendSuccessResponse("custom_update",
|
||||
"Starting custom OTA update. Device may reboot.", context);
|
||||
@@ -1269,7 +1272,7 @@ void CommandHandler::handleCustomUpdateCommand(JsonVariant contents, const Messa
|
||||
delay(1000);
|
||||
|
||||
// Perform the custom update
|
||||
bool result = _otaManager.performCustomUpdate(firmwareUrl, checksum, fileSize);
|
||||
bool result = _otaManager.performCustomUpdate(firmwareUrl, checksum, fileSize, version);
|
||||
|
||||
// Note: If update succeeds, device will reboot and this won't be reached
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user