[pre-commit.ci lite] apply automatic fixes

This commit is contained in:
pre-commit-ci-lite[bot]
2026-04-25 21:35:46 +00:00
committed by GitHub
parent eec9e90732
commit 2af5c4d82c
2 changed files with 11 additions and 10 deletions
@@ -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
@@ -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;
}