mirror of
https://github.com/esphome/esphome.git
synced 2026-05-31 17:06:40 +08:00
Merge remote-tracking branch 'origin/ota_fix_abort' into integration
This commit is contained in:
@@ -370,12 +370,14 @@ void ESPHomeOTAComponent::handle_data_() {
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
this->write_byte_(static_cast<uint8_t>(error_code));
|
this->write_byte_(static_cast<uint8_t>(error_code));
|
||||||
this->cleanup_connection_();
|
|
||||||
|
|
||||||
|
// Abort backend before cleanup - cleanup_connection_() destroys the backend
|
||||||
if (this->backend_ != nullptr && update_started) {
|
if (this->backend_ != nullptr && update_started) {
|
||||||
this->backend_->abort();
|
this->backend_->abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->cleanup_connection_();
|
||||||
|
|
||||||
this->status_momentary_error("err", 5000);
|
this->status_momentary_error("err", 5000);
|
||||||
#ifdef USE_OTA_STATE_LISTENER
|
#ifdef USE_OTA_STATE_LISTENER
|
||||||
this->notify_state_(ota::OTA_ERROR, 0.0f, static_cast<uint8_t>(error_code));
|
this->notify_state_(ota::OTA_ERROR, 0.0f, static_cast<uint8_t>(error_code));
|
||||||
|
|||||||
Reference in New Issue
Block a user