[pre-commit.ci lite] apply automatic fixes

This commit is contained in:
pre-commit-ci-lite[bot]
2026-04-24 20:01:28 +00:00
committed by GitHub
parent 33f754ef05
commit 2365431ebc
4 changed files with 9 additions and 11 deletions
@@ -105,15 +105,15 @@ void ESPHomeOTAComponent::dump_config() {
uint32_t running_app_offset;
size_t running_app_size;
ota::get_running_app_position(running_app_offset, running_app_size);
ESP_LOGCONFIG(TAG, " Running app:\n Partition address: 0x%X\n Used size: %d bytes",
running_app_offset, running_app_size);
ESP_LOGCONFIG(TAG, " Running app:\n Partition address: 0x%X\n Used size: %d bytes", running_app_offset,
running_app_size);
#ifdef USE_ESP32
ESP_LOGCONFIG(TAG, " Partition table:");
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
while (it != NULL) {
const esp_partition_t *p = esp_partition_get(it);
ESP_LOGCONFIG(TAG, " %s: type=0x%X, subtype=0x%X, address=0x%X, size=0x%X",
p->label, p->type, p->subtype, p->address, p->size);
ESP_LOGCONFIG(TAG, " %s: type=0x%X, subtype=0x%X, address=0x%X, size=0x%X", p->label, p->type, p->subtype,
p->address, p->size);
it = esp_partition_next(it);
}
esp_partition_iterator_release(it);
@@ -190,9 +190,9 @@ OTAResponseTypes IDFOTABackend::update_partition_table() {
get_running_app_position(running_app_offset, running_app_size);
// Get partition table partition
esp_err_t err = esp_partition_register_external(nullptr, ESP_PRIMARY_PARTITION_TABLE_OFFSET, ESP_PARTITION_TABLE_SIZE,
"PrimaryPrtTable", ESP_PARTITION_TYPE_PARTITION_TABLE,
ESP_PARTITION_SUBTYPE_PARTITION_TABLE_PRIMARY, &this->partition_table_part_);
esp_err_t err = esp_partition_register_external(
nullptr, ESP_PRIMARY_PARTITION_TABLE_OFFSET, ESP_PARTITION_TABLE_SIZE, "PrimaryPrtTable",
ESP_PARTITION_TYPE_PARTITION_TABLE, ESP_PARTITION_SUBTYPE_PARTITION_TABLE_PRIMARY, &this->partition_table_part_);
if (err != ESP_OK) {
ESP_LOGE(TAG, "esp_partition_register_external failed (err=0x%X) ", err);
return OTA_RESPONSE_ERROR_PARTITION_TABLE_VERIFY;
+1 -1
View File
@@ -14,7 +14,7 @@ static constexpr size_t OTA_BUFFER_SIZE = ESP_PARTITION_TABLE_MAX_LEN; // 0xC00
#endif
#ifdef USE_OTA_PARTITIONS
void get_running_app_position(uint32_t &offset, size_t &size);
void get_running_app_position(uint32_t &offset, size_t &size);
#endif
class IDFOTABackend final {
+1 -3
View File
@@ -210,9 +210,7 @@ def check_error(data: list[int] | bytes, expect: int | list[int] | None) -> None
"the firmware currently running on the device."
)
if dat == RESPONSE_ERROR_UNSUPPORTED_OTA_TYPE:
raise OTAError(
"Error: The requested OTA type is not supported by the device."
)
raise OTAError("Error: The requested OTA type is not supported by the device.")
if dat == RESPONSE_ERROR_PARTITION_TABLE_VERIFY:
raise OTAError(
"Error: The partition table update could not be verified. No changes were "