Use globals for version

Solves #1794
This commit is contained in:
Edward Firmo
2024-02-15 23:38:45 +01:00
parent 5324c4f4b3
commit 04248847a5
19 changed files with 29 additions and 29 deletions

View File

@@ -1761,8 +1761,8 @@ text_sensor:
- lambda: |-
static const char *const TAG = "text_sensor.version_blueprint";
ESP_LOGD(TAG, "Blueprint version: %s", x.c_str());
disp1->set_component_text_printf("boot.bluep_version", "%s", x.c_str());
if (current_page->state == "boot") {
disp1->set_component_text_printf("boot.bluep_version", "%s", x.c_str());
disp1->send_command_printf("tm_esphome.en=0");
page_boot->execute();
timer_reset_all->execute("boot");
@@ -1781,8 +1781,8 @@ text_sensor:
- lambda: |-
static const char *const TAG = "text_sensor.version_esphome";
ESP_LOGD(TAG, "ESPHome version: %s", x.c_str());
disp1->set_component_text_printf("boot.esph_version", x.c_str());
if (current_page->state == "boot") {
disp1->set_component_text_printf("esph_version", x.c_str());
disp1->send_command_printf("tm_esphome.en=0");
page_boot->execute();
timer_reset_all->execute("boot");
@@ -1792,7 +1792,7 @@ text_sensor:
- id: version_tft
name: Version TFT
platform: nextion
component_name: tft_version
component_name: boot.tft_version
entity_category: diagnostic
icon: mdi:tag-text-outline
internal: false
@@ -1966,6 +1966,7 @@ script:
page_changed->execute(current_page->state.c_str());
}
ESP_LOGV(TAG, "Current page: %s", current_page->state.c_str());
disp1->set_component_text_printf("boot.bluep_version", "%s", blueprint_version.c_str());
- if:
condition:
@@ -1975,7 +1976,6 @@ script:
then:
- lambda: |-
ESP_LOGV("script.global_settings", "Boot page is visible");
disp1->set_component_text_printf("boot.bluep_version", "%s", blueprint_version.c_str());
- wait_until:
condition:
- not:
@@ -2130,7 +2130,7 @@ script:
ESP_LOGV(TAG, "Construct boot page");
set_brightness->execute(100);
disp1->set_component_text_printf("esph_version", "${version}"); // ESPHome version
disp1->set_component_text_printf("boot.esph_version", "${version}"); // ESPHome version
disp1->set_component_text_printf("framework", "%s", id(framework) == 1 ? "Arduino" :
(id(framework) == 2 ? "ESP-IDF" : "Unknown")); // ESPHome framework
disp1->send_command_printf("tm_esphome.en=0");