diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index b707d73..e421ca3 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -2050,6 +2050,8 @@ script: - lambda: |- static const char *const TAG = "script.page_changed"; + // Go to boot page if not initiated + if (page != "boot" and not nextion_init->state) disp1->goto_page("boot"); // Reset globals if (page != "climate" && page != "cover" && @@ -2124,11 +2126,11 @@ script: static const char *const TAG = "script.page_boot"; if (construct_page) { ESP_LOGV(TAG, "Construct boot page"); - disp1->send_command_printf("tm_esphome.en=0"); - disp1->send_command_printf("tm_pageid.en=0"); - set_brightness->execute(100); - disp1->set_component_text_printf("boot.esph_version", "%s", "${version}"); // ### esphome-version ### - disp1->show_component("bt_reboot"); + if (current_page->state == "boot") { + set_brightness->execute(100); + disp1->set_component_text_printf("esph_version", "%s", "${version}"); // ### esphome-version ### + disp1->show_component("bt_reboot"); + } } - id: page_buttonpage @@ -2396,8 +2398,20 @@ script: - lambda: |- static const char *const TAG = "script.boot_sequence"; ESP_LOGD(TAG, "Starting boot sequence"); - if (current_page->state == "boot") page_boot->execute(true); + ESP_LOGD(TAG, "Wait for TFT version"); + - wait_until: + - lambda: !lambda return !id(version_tft).empty(); + - lambda: |- + static const char *const TAG = "script.boot_sequence"; + ESP_LOGD(TAG, "TFT version: %s", id(version_tft).c_str()); + if (current_page->state == "boot") { + disp1->send_command_printf("tm_esphome.en=0"); + disp1->send_command_printf("tm_pageid.en=0"); + page_boot->execute(true); + } timer_reset_all->execute("boot"); + - lambda: |- + static const char *const TAG = "script.boot_sequence"; ESP_LOGD(TAG, "Wait for API"); - wait_until: api.connected diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 1eb5d5b..a9e15ad 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 593491c..b7cd3f5 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/boot.txt b/nspanel_eu_code/boot.txt index ee3f1ab..92a0e33 100644 --- a/nspanel_eu_code/boot.txt +++ b/nspanel_eu_code/boot.txt @@ -21,6 +21,14 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF Touch Press Event printh 91 diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 4dd6d3c..3c70c6d 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 6359724..effe2be 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/boot.txt b/nspanel_us_code/boot.txt index ee3f1ab..92a0e33 100644 --- a/nspanel_us_code/boot.txt +++ b/nspanel_us_code/boot.txt @@ -21,6 +21,14 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF Touch Press Event printh 91 diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 723eae5..fc2f78c 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index 6eb30fe..b72e7f5 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/boot.txt b/nspanel_us_land_code/boot.txt index ee3f1ab..92a0e33 100644 --- a/nspanel_us_land_code/boot.txt +++ b/nspanel_us_land_code/boot.txt @@ -21,6 +21,14 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF Touch Press Event printh 91