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);
@@ -2157,6 +2159,27 @@ script:
}
}
- 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: