ESP-IDF v5 compatibility

This commit is contained in:
Edward Firmo
2024-01-09 11:38:17 +01:00
parent 973d8ec37a
commit 33cce61147
6 changed files with 61 additions and 87 deletions

View File

@@ -125,17 +125,18 @@ jobs:
with:
yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf.yaml"
#build_climate_cool_advanced_esp_idf5:
# name: esp-idf v5 & Bluetooth proxy
# runs-on: "ubuntu-latest"
# needs:
# - build_climate_cool_advanced_esp_idf
# steps:
# - uses: actions/checkout@v4.1.0
# - name: Build core+advanced+climate_cool+esp_idf5
# uses: esphome/build-action@v1.8.0
# with:
# yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf5.yaml"
build_climate_dual_esp_idf5:
name: esp-idf v5 & Climate Dual & Bluetooth proxy
runs-on: "ubuntu-latest"
needs:
- build_advanced
- build_climate_dual
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+climate_dual+bt_proxy+esp_idf5
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_dual_esp_idf5.yaml"
build_climate_heat_advanced_customization:
name: Customizations
@@ -149,17 +150,3 @@ jobs:
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat_customizations.yaml"
#build_climate_cool_advanced_esp_idf5:
# name: esp-idf v5 & Bluetooth proxy
# runs-on: "ubuntu-latest"
# needs:
# - build_climate_cool
# - build_advanced
# steps:
# - uses: actions/checkout@v4.1.0
# - name: Build core+advanced+climate_cool+esp_idf
# uses: esphome/build-action@v1.8.0
# with:
# yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf5.yaml"

View File

@@ -124,18 +124,19 @@ jobs:
yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf.yaml"
version: beta
#build_climate_cool_advanced_esp_idf5:
# name: esp-idf v5 & Bluetooth proxy
# runs-on: "ubuntu-latest"
# needs:
# - build_climate_cool_advanced_esp_idf
# steps:
# - uses: actions/checkout@v4.1.0
# - name: Build core+advanced+climate_cool+esp_idf5
# uses: esphome/build-action@v1.8.0
# with:
# yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf5.yaml"
# version: beta
build_climate_dual_esp_idf5:
name: esp-idf v5 & Climate Dual & Bluetooth proxy
runs-on: "ubuntu-latest"
needs:
- build_advanced
- build_climate_dual
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+climate_dual+bt_proxy+esp_idf5
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_dual_esp_idf5.yaml"
version: beta
build_climate_heat_advanced_customization:
name: Customizations
@@ -150,17 +151,3 @@ jobs:
with:
yaml_file: "./.test/esphome_advanced_climate_heat_customizations.yaml"
version: beta
#build_climate_cool_advanced_esp_idf5:
# name: esp-idf v5 & Bluetooth proxy
# runs-on: "ubuntu-latest"
# needs:
# - build_climate_cool
# - build_advanced
# steps:
# - uses: actions/checkout@v4.1.0
# - name: Build core+advanced+climate_cool+esp_idf
# uses: esphome/build-action@v1.8.0
# with:
# yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf5.yaml"
# version: beta

View File

@@ -6,10 +6,10 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
#advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
#addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
#addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
#addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
esp32:
framework:

View File

@@ -180,27 +180,27 @@ script:
if (addon_climate_cool) {
ESP_LOGI(TAG, " Cool: %s", addon_climate_cool ? "Enabled" : "Disabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGI(TAG, " Relay: %i", cooler_relay);
ESP_LOGI(TAG, " Relay: %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay: %i", cooler_relay);
ESP_LOGE(TAG, " Relay: %u", cooler_relay);
}
if (addon_climate_heat) {
ESP_LOGI(TAG, " Heat: %s", addon_climate_heat ? "Enabled" : "Disabled");
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGI(TAG, " Relay: %i", heater_relay);
ESP_LOGI(TAG, " Relay: %u", heater_relay);
else
ESP_LOGE(TAG, " Relay: %i", heater_relay);
ESP_LOGE(TAG, " Relay: %u", heater_relay);
}
if (addon_climate_dual) {
ESP_LOGI(TAG, " Dual: %s", addon_climate_dual ? "Enabled" : "Disabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGI(TAG, " Relay (cooler): %i", cooler_relay);
ESP_LOGI(TAG, " Relay (cooler): %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay (cooler): %i", cooler_relay);
ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay);
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGI(TAG, " Relay (heater): %i", heater_relay);
ESP_LOGI(TAG, " Relay (heater): %u", heater_relay);
else
ESP_LOGE(TAG, " Relay (heater): %i", heater_relay);
ESP_LOGE(TAG, " Relay (heater): %u", heater_relay);
if (cooler_relay == heater_relay)
ESP_LOGE(TAG, " Double relay assignment");
}

View File

@@ -202,12 +202,12 @@ script:
- lambda: |-
static const char *const TAG = "addon_upload_tft.script.restore_settings";
ESP_LOGD(TAG, "Restoring TFT file branch selector to index %i", id(tft_branch));
ESP_LOGD(TAG, "Restoring TFT file branch selector to index %u", id(tft_branch));
auto tft_file_branch_call = id(tft_file_branch).make_call();
tft_file_branch_call.set_index(id(tft_branch));
tft_file_branch_call.perform();
ESP_LOGD(TAG, "Restoring TFT file model selector to index %i", id(tft_model));
ESP_LOGD(TAG, "Restoring TFT file model selector to index %u", id(tft_model));
auto tft_file_model_call = id(tft_file_model).make_call();
tft_file_model_call.set_index(id(tft_model));
tft_file_model_call.perform();
@@ -304,7 +304,7 @@ script:
if (!is_baud_rate_supported(id(baud_rate_target))) id(baud_rate_target) = id(baud_rate_original);
ESP_LOGD(TAG, " Target upload baud rate: %d bps", id(baud_rate_target));
ESP_LOGD(TAG, " Current baud rate: %d bps", tf_uart->get_baud_rate());
ESP_LOGD(TAG, " Current baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());
// Upload URL
ESP_LOGD(TAG, " Upload URL: %s", url.c_str());
@@ -559,7 +559,7 @@ script:
ESP_LOGD(TAG, "Trying to upload TFT");
id(tft_upload_try)++;
char update_msg[128];
sprintf(update_msg, "Try #%d at %d bps", id(tft_upload_try), tf_uart->get_baud_rate());
sprintf(update_msg, "Try #%d at %" PRIu32 " bps", id(tft_upload_try), tf_uart->get_baud_rate());
report_upload_progress->execute(update_msg);
- script.wait: report_upload_progress
- wait_until:
@@ -672,7 +672,7 @@ script:
auto upload_end_ = [&](bool completed) -> bool
{
static const char *const TAG = "script.upload_tft.upload_end_";
ESP_LOGD(TAG, "Completed: %i", completed ? 1 : 0);
ESP_LOGD(TAG, "Completed: %s", completed ? "True" : "False");
//ESP_LOGD(TAG, "Restarting Nextion");
//send_nextion_command("rest");
#ifdef ARDUINO
@@ -796,12 +796,12 @@ script:
}
return range_end + 1;
};
auto upload_tft_ = [&](const std::string &url, unsigned int update_baud_rate_) -> bool
auto upload_tft_ = [&](const std::string &url, uint32_t update_baud_rate_) -> bool
{
static const char *const TAG = "addon_upload_tft.script.upload_tft.upload_tft_arduino";
ESP_LOGD(TAG, "Nextion TFT upload requested");
ESP_LOGD(TAG, " url: %s", url.c_str());
ESP_LOGD(TAG, " baud_rate: %i", update_baud_rate_);
ESP_LOGD(TAG, " baud_rate: %" PRIu32, update_baud_rate_);
if (is_updating_) {
ESP_LOGD(TAG, "Currently updating");
@@ -960,15 +960,15 @@ script:
auto upload_range_esp_idf_ = [&](const std::string &url, int range_start) -> int {
static const char *const TAG = "addon_upload_tft.script.upload_tft.upload_range_esp_idf_";
ESP_LOGVV(TAG, "url: %s", url.c_str());
uint range_size_ = tft_size_ - range_start;
uint32_t range_size_ = tft_size_ - range_start;
ESP_LOGVV(TAG, "tft_size_: %i", tft_size_);
ESP_LOGV(TAG, "Available heap: %u", esp_get_free_heap_size());
ESP_LOGV(TAG, "Available heap: %" PRIu32, esp_get_free_heap_size());
int range_end = (range_start == 0) ? std::min(tft_size_, 16383) : tft_size_;
if (range_size_ <= 0 or range_end <= range_start) {
ESP_LOGE(TAG, "Invalid range");
ESP_LOGD(TAG, "Range start: %i", range_start);
ESP_LOGD(TAG, "Range end: %i", range_end);
ESP_LOGD(TAG, "Range size: %i", range_size_);
ESP_LOGD(TAG, "Range size: %" PRIu32, range_size_);
return -1;
}
@@ -1007,7 +1007,7 @@ script:
std::string recv_string;
if (buffer == nullptr) {
ESP_LOGE(TAG, "Failed to allocate memory for buffer");
ESP_LOGV(TAG, "Available heap: %u", esp_get_free_heap_size());
ESP_LOGV(TAG, "Available heap: %" PRIu32, esp_get_free_heap_size());
} else {
ESP_LOGV(TAG, "Memory for buffer allocated successfully");
@@ -1067,7 +1067,7 @@ script:
static const char *const TAG = "addon_upload_tft.script.upload_tft.upload_tft_esp_idf";
ESP_LOGD(TAG, "Nextion TFT upload requested");
ESP_LOGD(TAG, " url: %s", url.c_str());
ESP_LOGD(TAG, " baud_rate: %i", update_baud_rate_);
ESP_LOGD(TAG, " baud_rate: %u", update_baud_rate_);
if (is_updating_) {
ESP_LOGW(TAG, "Currently updating");
@@ -1099,7 +1099,7 @@ script:
// Initialize the HTTP client with the configuration
ESP_LOGV(TAG, "Initializing HTTP client");
ESP_LOGV(TAG, "Available heap: %u", esp_get_free_heap_size());
ESP_LOGV(TAG, "Available heap: %" PRIu32, esp_get_free_heap_size());
esp_http_client_handle_t http = esp_http_client_init(&config);
if (!http) {
ESP_LOGE(TAG, "Failed to initialize HTTP client.");
@@ -1108,7 +1108,7 @@ script:
// Perform the HTTP request
ESP_LOGV(TAG, "Check if the client could connect");
ESP_LOGV(TAG, "Available heap: %u", esp_get_free_heap_size());
ESP_LOGV(TAG, "Available heap: %" PRIu32, esp_get_free_heap_size());
esp_err_t err = esp_http_client_perform(http);
if (err != ESP_OK) {
ESP_LOGE(TAG, "HTTP request failed: %s", esp_err_to_name(err));
@@ -1199,7 +1199,7 @@ script:
if (upload_tft_(url, 115200)) App.safe_reboot();
char update_msg[128];
sprintf(update_msg, "Try #%d at %d bps failed!", id(tft_upload_try), tf_uart->get_baud_rate());
sprintf(update_msg, "Try #%d at %" PRIu32 " bps failed!", id(tft_upload_try), tf_uart->get_baud_rate());
report_upload_progress->execute(update_msg);
ESP_LOGD(TAG, "Finished!");
- script.wait: report_upload_progress
@@ -1211,7 +1211,7 @@ script:
- lambda: !lambda id(tft_upload_try)++;
- lambda: |-
char update_msg[128];
sprintf(update_msg, "Try #%d at %d bps", id(tft_upload_try), tf_uart->get_baud_rate());
sprintf(update_msg, "Try #%d at %" PRIu32 " bps", id(tft_upload_try), tf_uart->get_baud_rate());
report_upload_progress->execute(update_msg);
- script.wait: report_upload_progress
- wait_until:
@@ -1222,7 +1222,7 @@ script:
- script.wait: nextion_upload
- lambda: |-
char update_msg[128];
sprintf(update_msg, "Try #%d at %d bps failed!", id(tft_upload_try), tf_uart->get_baud_rate());
sprintf(update_msg, "Try #%d at %" PRIu32 " bps failed!", id(tft_upload_try), tf_uart->get_baud_rate());
report_upload_progress->execute(update_msg);
- script.wait: report_upload_progress

View File

@@ -499,12 +499,12 @@ api:
then:
- lambda: |-
static const char *const TAG = "service.page_home";
ESP_LOGV(TAG, "date_color: %i", date_color);
ESP_LOGV(TAG, "date_color: %" PRIi32, date_color);
ESP_LOGV(TAG, "time_format: %s", time_format.c_str());
ESP_LOGV(TAG, "time_color: %i", time_color);
ESP_LOGV(TAG, "time_color: %" PRIi32, time_color);
ESP_LOGV(TAG, "meridiem: %i", meridiem.size());
ESP_LOGV(TAG, "chip_font_size: %i", chip_font_size);
ESP_LOGV(TAG, "custom_buttons_font_size: %i", custom_buttons_font_size);
ESP_LOGV(TAG, "chip_font_size: %" PRIi32, chip_font_size);
ESP_LOGV(TAG, "custom_buttons_font_size: %" PRIi32, custom_buttons_font_size);
ESP_LOGV(TAG, "notification_icon: %s", notification_icon.c_str());
ESP_LOGV(TAG, "notification_icon_color_normal: %i", notification_icon_color_normal.size());
ESP_LOGV(TAG, "notification_icon_color_unread: %i", notification_icon_color_unread.size());
@@ -1834,7 +1834,7 @@ script:
mui_please_confirm: string
mui_unavailable: string
screensaver_time: bool
screensaver_time_color: int[]
screensaver_time_color: int32_t[]
then:
- lambda: |-
static const char *const TAG = "script.global_settings";
@@ -1986,7 +1986,7 @@ script:
page: string
page_label: string
page_icon: string
page_icon_color: int[]
page_icon_color: int32_t[]
entity: string
back_page: string
then:
@@ -2462,7 +2462,7 @@ script:
then:
- lambda: |-
static const char *const TAG = "script.set_baud_rate";
ESP_LOGD(TAG, "Baud rate changing from %i to %i bps", tf_uart->get_baud_rate(), baud_rate);
ESP_LOGD(TAG, "Baud rate changing from %" PRIu32 " to %i bps", tf_uart->get_baud_rate(), baud_rate);
ESP_LOGD(TAG, "Flush UART");
- wait_until:
condition:
@@ -3162,7 +3162,7 @@ script:
// Report UART
ESP_LOGI(TAG, "UART:");
ESP_LOGI(TAG, " Baud rate: %d bps", tf_uart->get_baud_rate());
ESP_LOGI(TAG, " Baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());
ESP_LOGI(TAG, " Queue size: %d", tf_uart->available());
// Report Nextion status