Disable boot timer when all info is available

This commit is contained in:
Edward Firmo
2024-03-17 14:35:59 +01:00
parent 9e6fb6eb85
commit d28ab920c8
10 changed files with 39 additions and 63 deletions

View File

@@ -1815,10 +1815,13 @@ script:
ESP_LOGD("script.boot_progress", "Progress: Completed"); ESP_LOGD("script.boot_progress", "Progress: Completed");
disp1->set_component_value("boot.progress", 100); disp1->set_component_value("boot.progress", 100);
} else { } else {
step = int(round((blueprint_status->state + (step*10))/2)); step = std::min(100, int(round((blueprint_status->state + (step*10))/2)));
ESP_LOGD("script.boot_progress", "Progress: %i%%", step); ESP_LOGD("script.boot_progress", "Progress: %i%%", step);
disp1->set_component_value("boot.progress", step); disp1->set_component_value("boot.progress", step);
} }
if (current_page->state == "boot" and !isnan(display_charset->state) and !isnan(display_mode->state) and !version_tft->state.empty())
disp1->send_command_printf("tm_esphome.en=0");
- id: change_climate_state - id: change_climate_state
mode: restart mode: restart
@@ -1968,9 +1971,12 @@ script:
page: string page: string
then: then:
- lambda: |- - lambda: |-
ESP_LOGW("DEBUG", "goto_page: from %s to %s", current_page->state.c_str(), page.c_str()); ESP_LOGD("DEBUG", "goto_page: from %s to %s", current_page->state.c_str(), page.c_str());
if (current_page->state != page) if (current_page->state != page) {
disp1->goto_page(page.c_str()); disp1->goto_page(page.c_str());
} else {
ESP_LOGE("DEBUG", "goto_page: from %s to %s", current_page->state.c_str(), page.c_str());
}
- id: ha_button - id: ha_button
mode: parallel mode: parallel
@@ -2049,7 +2055,7 @@ script:
disp1->send_command_printf("tm_esphome.en=0"); disp1->send_command_printf("tm_esphome.en=0");
- id: page_boot - id: page_boot
mode: restart mode: single
then: then:
- logger.log: Page boot called - logger.log: Page boot called
- lambda: |- - lambda: |-
@@ -2140,15 +2146,15 @@ script:
disp1->set_component_font_color("home.chip_relay1", id(home_relay1_icon_color)); disp1->set_component_font_color("home.chip_relay1", id(home_relay1_icon_color));
disp1->set_component_font_color("home.chip_relay2", id(home_relay2_icon_color)); disp1->set_component_font_color("home.chip_relay2", id(home_relay2_icon_color));
boot_progress->execute(8); boot_progress->execute(8);
boot_progress->execute(9);
- wait_until: - wait_until:
condition: condition:
- lambda: return (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99); - lambda: return (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99);
timeout: 10s timeout: 10s
- lambda: boot_progress->execute(10);
- delay: 5s - delay: 5s
- lambda: |- - lambda: |-
boot_progress->execute(9);
if (notification_sound->state) buzzer->play("two short:d=4,o=5,b=100:16e6,16e6"); if (notification_sound->state) buzzer->play("two short:d=4,o=5,b=100:16e6,16e6");
boot_progress->execute(10);
set_brightness->execute(display_brightness->state); set_brightness->execute(display_brightness->state);
ESP_LOGD("script.page_boot", "Jump to wake-up page: %s", wakeup_page_name->state.c_str()); ESP_LOGD("script.page_boot", "Jump to wake-up page: %s", wakeup_page_name->state.c_str());
goto_page->execute(wakeup_page_name->state.c_str()); goto_page->execute(wakeup_page_name->state.c_str());
@@ -2985,7 +2991,4 @@ script:
condition: condition:
- lambda: return (!isnan(display_charset->state) and !isnan(display_mode->state) and !(version_tft->state.empty())); - lambda: return (!isnan(display_charset->state) and !isnan(display_mode->state) and !(version_tft->state.empty()));
timeout: 10s timeout: 10s
- lambda: |-
if (current_page->state == "boot")
disp1->send_command_printf("tm_esphome.en=%i", (isnan(display_charset->state) or isnan(display_mode->state) or version_tft->state.empty()) ? 1 : 0);
... ...

View File

@@ -32,13 +32,6 @@ Variable (int32) counter
Scope: local Scope: local
Value: 0 Value: 0
Variable (string) aux1
Attributes
ID : 12
Scope : local
Text :
Max. Text Size: 10
Text ip_addr Text ip_addr
Attributes Attributes
ID : 1 ID : 1
@@ -116,8 +109,8 @@ Text esph_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text bluep_version Text bluep_version
Attributes Attributes
@@ -126,12 +119,12 @@ Text bluep_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text baud_rate Text baud_rate
Attributes Attributes
ID : 14 ID : 13
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -141,7 +134,7 @@ Text baud_rate
Text framework Text framework
Attributes Attributes
ID : 15 ID : 14
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -151,7 +144,7 @@ Text framework
Text unavailable Text unavailable
Attributes Attributes
ID : 16 ID : 15
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : disabled Send Component ID : disabled
@@ -161,7 +154,7 @@ Text unavailable
Progress Bar progress Progress Bar progress
Attributes Attributes
ID : 17 ID : 16
Scope : global Scope : global
Dragging : 0 Dragging : 0
Send Component ID: disabled Send Component ID: disabled
@@ -186,7 +179,7 @@ Dual-state Button bt_reboot
Timer tm_esphome Timer tm_esphome
Attributes Attributes
ID : 13 ID : 12
Scope : local Scope : local
Period (ms): 1000 Period (ms): 1000
Enabled : yes Enabled : yes
@@ -224,8 +217,6 @@ Timer tm_esphome
prints tft_version.txt,0 prints tft_version.txt,0
printh 00 printh 00
printh FF FF FF printh FF FF FF
covx counter.val,aux1.txt,0,0
esph_version.txt="Retry #"+aux1.txt
sys0=counter.val%10 sys0=counter.val%10
if(sys0==0) if(sys0==0)
{ {

View File

@@ -32,13 +32,6 @@ Variable (int32) counter
Scope: local Scope: local
Value: 0 Value: 0
Variable (string) aux1
Attributes
ID : 12
Scope : local
Text :
Max. Text Size: 10
Text ip_addr Text ip_addr
Attributes Attributes
ID : 1 ID : 1
@@ -123,8 +116,8 @@ Text esph_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text bluep_version Text bluep_version
Attributes Attributes
@@ -133,12 +126,12 @@ Text bluep_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text baud_rate Text baud_rate
Attributes Attributes
ID : 14 ID : 13
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -148,7 +141,7 @@ Text baud_rate
Text framework Text framework
Attributes Attributes
ID : 15 ID : 14
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -158,7 +151,7 @@ Text framework
Text unavailable Text unavailable
Attributes Attributes
ID : 16 ID : 15
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : disabled Send Component ID : disabled
@@ -168,7 +161,7 @@ Text unavailable
Progress Bar progress Progress Bar progress
Attributes Attributes
ID : 17 ID : 16
Scope : global Scope : global
Dragging : 0 Dragging : 0
Send Component ID: disabled Send Component ID: disabled
@@ -193,7 +186,7 @@ Dual-state Button bt_reboot
Timer tm_esphome Timer tm_esphome
Attributes Attributes
ID : 13 ID : 12
Scope : local Scope : local
Period (ms): 1000 Period (ms): 1000
Enabled : yes Enabled : yes
@@ -231,8 +224,6 @@ Timer tm_esphome
prints tft_version.txt,0 prints tft_version.txt,0
printh 00 printh 00
printh FF FF FF printh FF FF FF
covx counter.val,aux1.txt,0,0
esph_version.txt="Retry #"+aux1.txt
sys0=counter.val%10 sys0=counter.val%10
if(sys0==0) if(sys0==0)
{ {

View File

@@ -32,13 +32,6 @@ Variable (int32) counter
Scope: local Scope: local
Value: 0 Value: 0
Variable (string) aux1
Attributes
ID : 12
Scope : local
Text :
Max. Text Size: 10
Text ip_addr Text ip_addr
Attributes Attributes
ID : 1 ID : 1
@@ -116,8 +109,8 @@ Text esph_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text bluep_version Text bluep_version
Attributes Attributes
@@ -126,12 +119,12 @@ Text bluep_version
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
Associated Keyboard: none Associated Keyboard: none
Text : Text : Waiting...
Max. Text Size : 9 Max. Text Size : 10
Text baud_rate Text baud_rate
Attributes Attributes
ID : 14 ID : 13
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -141,7 +134,7 @@ Text baud_rate
Text framework Text framework
Attributes Attributes
ID : 15 ID : 14
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : on press and release Send Component ID : on press and release
@@ -151,7 +144,7 @@ Text framework
Text unavailable Text unavailable
Attributes Attributes
ID : 16 ID : 15
Scope : local Scope : local
Dragging : 0 Dragging : 0
Send Component ID : disabled Send Component ID : disabled
@@ -161,7 +154,7 @@ Text unavailable
Progress Bar progress Progress Bar progress
Attributes Attributes
ID : 17 ID : 16
Scope : global Scope : global
Dragging : 0 Dragging : 0
Send Component ID: disabled Send Component ID: disabled
@@ -186,7 +179,7 @@ Dual-state Button bt_reboot
Timer tm_esphome Timer tm_esphome
Attributes Attributes
ID : 13 ID : 12
Scope : local Scope : local
Period (ms): 1000 Period (ms): 1000
Enabled : yes Enabled : yes
@@ -224,8 +217,6 @@ Timer tm_esphome
prints tft_version.txt,0 prints tft_version.txt,0
printh 00 printh 00
printh FF FF FF printh FF FF FF
covx counter.val,aux1.txt,0,0
esph_version.txt="Retry #"+aux1.txt
sys0=counter.val%10 sys0=counter.val%10
if(sys0==0) if(sys0==0)
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.