Skip to content

Commit

Permalink
Announce boot page from timer
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardtfn committed Oct 25, 2024
1 parent 9ee9d7f commit e2671f7
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 53 deletions.
18 changes: 7 additions & 11 deletions esphome/nspanel_esphome_core_boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ display:
}
}
esphome:
on_boot:
- priority: 500
then:
- script.execute: boot_sequence
- script.wait: boot_sequence
- lambda: |-
boot_log->execute("Boot", "Jump to wake-up page");
goto_page->execute(wakeup_page_name->state.c_str(), true);
set_variable_value->execute("wakeup_page_id", get_page_id(wakeup_page_name->state.c_str()));
script:
- id: boot_event
mode: restart
Expand Down Expand Up @@ -124,6 +113,13 @@ script:
condition:
- lambda: return disp1->is_setup();
timeout: 10s
- lambda: |-
if (current_page->state != "boot")
boot_log->execute("Boot", "Waiting for page Boot");
- wait_until:
condition:
- lambda: return current_page->state == "boot";
timeout: 10s
- lambda: |-
if (!wifi_component->is_connected())
boot_log->execute("Boot", "Waiting for Wi-Fi");
Expand Down
27 changes: 21 additions & 6 deletions esphome/nspanel_esphome_core_page_home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ script:
- lambda: |-
disp1->send_command_printf("home.chip%02" PRIu32 ".font=%" PRIu8, iteration, chip_font);
- script.execute:
id: boot_progress
step: ${BOOT_STEP_PAGE_HOME}
step_name: Page Home - Chip font
id: page_home_boot_progress
sub_step_name: Chip font

- id: custom_buttons_font
mode: restart
Expand All @@ -97,9 +96,8 @@ script:
- lambda: |-
disp1->send_command_printf("home.button%02" PRIu32 ".font=%" PRIu8, iteration, custom_buttons_font);
- script.execute:
id: boot_progress
step: ${BOOT_STEP_PAGE_HOME}
step_name: Page Home - Custom buttons font
id: page_home_boot_progress
sub_step_name: Custom buttons font

- id: !extend boot_sequence
then:
Expand All @@ -123,6 +121,22 @@ script:
# - nspanel_esphome_core_hw_wifi.yaml
# - nspanel_esphome_core_page_weather.yaml

- id: page_home_boot_progress
mode: queued
parameters:
sub_step_name: string
then:
- lambda: |-
static uint8_t page_home_boot_steps_count = 0;
page_home_boot_steps_count++;
ESP_LOGW("DEBUG", "page_home_boot_steps_count: %" PRIu8, page_home_boot_steps_count);
boot_progress->execute(${BOOT_STEP_PAGE_HOME}, ("Page Home - " + sub_step_name).c_str());
if (current_page->state == "boot" and wakeup_page_name->state == "home") {
ESP_LOGI("script.page_home_boot_progress", "Jump to Home page");
goto_page->execute("home", true);
set_variable_value->execute("wakeup_page_id", get_page_id("home"));
}
- id: !extend set_var_int
then:
- lambda: |-
Expand All @@ -146,4 +160,5 @@ script:
chip_font->stop();
custom_buttons_font->stop();
page_home->stop();
page_home_boot_progress->stop();
...
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_CJK_eu_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_CJK_us_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_CJK_us_land_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_eu_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_us_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
12 changes: 6 additions & 6 deletions hmi/dev/nspanel_us_land_code/boot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Page boot

Events
Preinitialize Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
dim=100
ver_tft.txt="TFT: "+version.txt
click sys_baudrate,1
Expand Down Expand Up @@ -323,6 +317,12 @@ Timer tm_esphome

Events
Timer Event
printh 92
prints "current_page",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
counter.val++
if(counter.val>30)
{
Expand Down
Binary file modified hmi/nspanel_CJK_eu.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_eu.tft
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us.tft
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us_land.HMI
Binary file not shown.
Binary file modified hmi/nspanel_CJK_us_land.tft
Binary file not shown.
Binary file modified hmi/nspanel_eu.HMI
Binary file not shown.
Binary file modified hmi/nspanel_eu.tft
Binary file not shown.
Binary file modified hmi/nspanel_us.HMI
Binary file not shown.
Binary file modified hmi/nspanel_us.tft
Binary file not shown.
Binary file modified hmi/nspanel_us_land.HMI
Binary file not shown.
Binary file modified hmi/nspanel_us_land.tft
Binary file not shown.

0 comments on commit e2671f7

Please sign in to comment.