mirror of
https://github.com/esphome/esphome.git
synced 2026-09-13 16:18:41 +00:00
Apply suggestions
This commit is contained in:
@@ -77,7 +77,7 @@ def ota_esphome_final_validate(config):
|
||||
merged_ota_esphome_configs_by_port[conf_port] = merge_config(
|
||||
merged_ota_esphome_configs_by_port[conf_port], ota_conf
|
||||
)
|
||||
if config.get(CONF_ALLOW_PARTITION_ACCESS, False) and not CORE.is_esp32:
|
||||
if ota_conf.get(CONF_ALLOW_PARTITION_ACCESS, False) and not CORE.is_esp32:
|
||||
raise cv.Invalid(
|
||||
f"{CONF_ALLOW_PARTITION_ACCESS} is only supported on the esp32"
|
||||
)
|
||||
|
||||
@@ -347,6 +347,7 @@ OTAResponseTypes IDFOTABackend::update_partition_table() {
|
||||
ESP_LOGE(TAG, "esp_ota_end failed (err=0x%X) ", err);
|
||||
return OTA_RESPONSE_ERROR_PARTITION_TABLE_UPDATE;
|
||||
}
|
||||
esp_partition_deregister_external(this->partition_table_part_);
|
||||
this->partition_table_part_ = nullptr;
|
||||
esp_partition_unload_all();
|
||||
|
||||
@@ -358,12 +359,12 @@ OTAResponseTypes IDFOTABackend::update_partition_table() {
|
||||
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) {
|
||||
ESP_LOGD(TAG, "Setting next boot partition to 0x%X", p->address);
|
||||
new_boot_partition = p;
|
||||
}
|
||||
it = esp_partition_next(it);
|
||||
}
|
||||
esp_partition_iterator_release(it);
|
||||
ESP_LOGD(TAG, "Setting next boot partition to 0x%X", new_boot_partition->address);
|
||||
err = esp_ota_set_boot_partition(new_boot_partition);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (err=0x%X) ", err);
|
||||
|
||||
Reference in New Issue
Block a user