Handle boot with blank tft

This commit is contained in:
Edward Firmo
2023-11-10 12:30:43 +01:00
parent eb3a643f76
commit 889aa4fd43
3 changed files with 27 additions and 4 deletions

View File

@@ -1441,6 +1441,7 @@ text_sensor:
}
else service_call_alarm_control_panel->execute(entity.c_str(), key.c_str(), code_format.c_str(), "");
}
else if (page == "blank") page_blank->execute(true);
else if (page == "boot")
{
// Detect display mode
@@ -2110,6 +2111,7 @@ script:
// Call page constructor
if (page == "alarm") page_alarm->execute(true);
else if (page == "blank") page_blank->execute(true);
else if (page == "boot") page_boot->execute(true);
else if (page == "buttonpage01") page_buttonpage->execute(true, 1);
else if (page == "buttonpage02") page_buttonpage->execute(true, 2);
@@ -2148,15 +2150,36 @@ script:
ESP_LOGV(TAG, "Construct alarm page");
if (current_page->state == "alarm") {
// Alarm page - Button's icons
disp1->set_component_text_printf("bt_home_icon", "\uE689"); //mdi:shield-home
disp1->set_component_text_printf("bt_away_icon", "\uE99C"); //mdi:shield-lock
disp1->set_component_text_printf("bt_night_icon", "\uF827"); //mdi:shield-moon
disp1->set_component_text_printf("bt_vacat_icon", "\uE6BA"); //mdi:shield-airplane
disp1->set_component_text_printf("bt_home_icon", "\uE689"); //mdi:shield-home
disp1->set_component_text_printf("bt_away_icon", "\uE99C"); //mdi:shield-lock
disp1->set_component_text_printf("bt_night_icon", "\uF827"); //mdi:shield-moon
disp1->set_component_text_printf("bt_vacat_icon", "\uE6BA"); //mdi:shield-airplane
disp1->set_component_text_printf("bt_bypass_icon", "\uE77F"); //mdi:shield-half-full
disp1->set_component_text_printf("bt_disarm_icon", "\uE99D"); //mdi:shield-off
}
}
- id: page_blank
mode: restart
parameters:
construct_page: bool
then:
- lambda: |-
static const char *const TAG = "script.page_blank";
if (construct_page) {
ESP_LOGV(TAG, "Construct blank page");
std::string framework = "unknown";
#ifdef ARDUINO
framework = "arduino";
#elif defined(USE_ESP_IDF)
framework = "esp-idf";
#endif
disp1->set_component_text_printf("esp_version", "ESP: ${version}"); // ESPHome version
disp1->set_component_text_printf("framework", framework.c_str()); // ESPHome framework
disp1->send_command_printf("tm_esphome.en=0");
disp1->send_command_printf("tm_pageid.en=0");
}
- id: page_boot
mode: restart
parameters: