Unify set_tft_file
This commit is contained in:
@@ -135,11 +135,8 @@ script:
|
|||||||
disp1->hide_component("bt_accept");
|
disp1->hide_component("bt_accept");
|
||||||
disp1->hide_component("bt_clear");
|
disp1->hide_component("bt_clear");
|
||||||
disp1->hide_component("bt_close");
|
disp1->hide_component("bt_close");
|
||||||
#ifdef ARDUINO
|
disp1->set_component_text_printf("confirm.title", "Upload TFT\\r%s",
|
||||||
disp1->set_component_text_printf("confirm.title", "Upload TFT\\rArduino");
|
id(framework) == 1 ? "Arduino" : (id(framework) == 2 ? "ESP-IDF" : "Unknown"));
|
||||||
#elif defined(ESP_PLATFORM)
|
|
||||||
disp1->set_component_text_printf("confirm.title", "Upload TFT\\rESP-IDF");
|
|
||||||
#endif
|
|
||||||
page_id->update();
|
page_id->update();
|
||||||
|
|
||||||
- id: report_settings
|
- id: report_settings
|
||||||
@@ -176,11 +173,7 @@ script:
|
|||||||
then:
|
then:
|
||||||
- delay: 2s
|
- delay: 2s
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
#ifdef ARDUINO
|
static const char *const TAG = "addon_upload_tft.script.set_tft_file";
|
||||||
static const char *const TAG = "addon_upload_tft.script.set_tft_file.arduino";
|
|
||||||
#elif defined(ESP_PLATFORM)
|
|
||||||
static const char *const TAG = "addon_upload_tft.script.set_tft_file.esp_idf";
|
|
||||||
#endif
|
|
||||||
std::string branch = "v${version}";
|
std::string branch = "v${version}";
|
||||||
if (branch.find("beta") != std::string::npos) branch = "beta";
|
if (branch.find("beta") != std::string::npos) branch = "beta";
|
||||||
else if (branch.find("dev") != std::string::npos) branch = "dev";
|
else if (branch.find("dev") != std::string::npos) branch = "dev";
|
||||||
@@ -192,9 +185,6 @@ script:
|
|||||||
if (id(is_uploading_tft))
|
if (id(is_uploading_tft))
|
||||||
ESP_LOGW(TAG, " TFT Upload in progress.");
|
ESP_LOGW(TAG, " TFT Upload in progress.");
|
||||||
else {
|
else {
|
||||||
#ifdef ARDUINO
|
|
||||||
std::string url = "${nextion_update_url}";
|
|
||||||
#elif defined(ESP_PLATFORM)
|
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
if (model == "NSPanel Blank") file_name = "nspanel_blank.tft";
|
if (model == "NSPanel Blank") file_name = "nspanel_blank.tft";
|
||||||
@@ -215,7 +205,6 @@ script:
|
|||||||
url = url.substr(0, endPos + 1);
|
url = url.substr(0, endPos + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
ESP_LOGD(TAG, " Full URL: %s", url.c_str());
|
ESP_LOGD(TAG, " Full URL: %s", url.c_str());
|
||||||
id(tft_url) = url;
|
id(tft_url) = url;
|
||||||
|
|||||||
Reference in New Issue
Block a user