From 2af5c4d82ce0d4fbad738f5e99807656e4ee9b1e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:35:46 +0000 Subject: [PATCH] [pre-commit.ci lite] apply automatic fixes --- esphome/components/esphome/ota/ota_esphome.cpp | 14 +++++++------- esphome/components/ota/ota_backend_esp_idf.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index f9133a515f6..e5db0df462a 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -224,23 +224,23 @@ void ESPHomeOTAComponent::handle_handshake_() { ESP_LOGV(TAG, "Features: 0x%02X", this->ota_features_); this->transition_ota_state_(OTAState::FEATURE_ACK); - const bool supports_compression = ((this->ota_features_ & CLIENT_FEATURE_SUPPORTS_COMPRESSION) != 0 && - this->backend_->supports_compression()); + const bool supports_compression = + ((this->ota_features_ & CLIENT_FEATURE_SUPPORTS_COMPRESSION) != 0 && this->backend_->supports_compression()); #ifdef USE_OTA_PARTITIONS this->extended_proto_ = this->ota_features_ & CLIENT_FEATURE_SUPPORTS_EXTENDED_PROTOCOL; if (this->extended_proto_) { // If the client supports the extended protocol, send 2 bytes: response type and server feature flags - this->handshake_buf_[0] = ota::OTA_RESPONSE_FEATURE_FLAGS; // indicates the following byte contains feature flags - this->handshake_buf_[1] = SERVER_FEATURE_SUPPORTS_PARTITION_ACCESS; // supported if USE_OTA_PARTITIONS + this->handshake_buf_[0] = + ota::OTA_RESPONSE_FEATURE_FLAGS; // indicates the following byte contains feature flags + this->handshake_buf_[1] = SERVER_FEATURE_SUPPORTS_PARTITION_ACCESS; // supported if USE_OTA_PARTITIONS if (supports_compression) { this->handshake_buf_[1] |= SERVER_FEATURE_SUPPORTS_COMPRESSION; } } else { #endif // Standard protocol without server feature flags - this->handshake_buf_[0] = (supports_compression) - ? ota::OTA_RESPONSE_SUPPORTS_COMPRESSION - : ota::OTA_RESPONSE_HEADER_OK; + this->handshake_buf_[0] = + (supports_compression) ? ota::OTA_RESPONSE_SUPPORTS_COMPRESSION : ota::OTA_RESPONSE_HEADER_OK; #ifdef USE_OTA_PARTITIONS } #endif diff --git a/esphome/components/ota/ota_backend_esp_idf.cpp b/esphome/components/ota/ota_backend_esp_idf.cpp index 3e79b69e674..6a2afac9789 100644 --- a/esphome/components/ota/ota_backend_esp_idf.cpp +++ b/esphome/components/ota/ota_backend_esp_idf.cpp @@ -179,7 +179,7 @@ void IDFOTABackend::abort() { #ifdef USE_OTA_PARTITIONS static inline bool check_overlap(uint32_t a_offset, size_t a_size, uint32_t b_offset, size_t b_size) { - return (a_offset + a_size > b_offset && b_offset + b_size > a_offset); + return (a_offset + a_size > b_offset && b_offset + b_size > a_offset); } OTAResponseTypes IDFOTABackend::update_partition_table() { @@ -268,7 +268,7 @@ OTAResponseTypes IDFOTABackend::update_partition_table() { if (p->address == new_part->pos.offset && p->size >= running_app_size) { // Found a suitable pair of partitions in the old and new partition table to copy the running app to new_app_part_index_with_copy = i; // The partition index in the new partition table - app_copy_target_part = p; // The partition in the old partition table + app_copy_target_part = p; // The partition in the old partition table } it = esp_partition_next(it); } @@ -349,7 +349,8 @@ OTAResponseTypes IDFOTABackend::update_partition_table() { esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, NULL); while (it != NULL) { const esp_partition_t *p = esp_partition_get(it); - const esp_partition_info_t *new_part = &new_partition_table[new_app_part_index == -1 ? new_app_part_index_with_copy : new_app_part_index]; + const esp_partition_info_t *new_part = + &new_partition_table[new_app_part_index == -1 ? new_app_part_index_with_copy : new_app_part_index]; if (p->address == new_part->pos.offset) { new_boot_partition = p; }