Store TFT file to resist power cycle

This commit is contained in:
Edward Firmo
2024-01-04 10:53:06 +01:00
parent 7414d116fd
commit 8f46a44cca

View File

@@ -213,6 +213,7 @@ script:
- id: set_tft_file
mode: restart
then:
- delay: 2s
- lambda: |-
static const char *const TAG = "addon_upload_tft.script.set_tft_file";
std::string model = tft_file_model->state;
@@ -1239,8 +1240,9 @@ select:
disabled_by_default: false
icon: mdi:file-sync
set_action:
- lambda: if (tft_file_model->active_index().has_value()) id(tft_model) = tft_file_model->active_index().value();
- script.execute: set_tft_file
- lambda: |-
if (tft_file_model->active_index().has_value()) id(tft_model) = tft_file_model->active_index().value();
set_tft_file->execute();
- id: tft_file_branch
name: ${device_name} Update TFT display - Branch
@@ -1257,8 +1259,9 @@ select:
disabled_by_default: true
icon: mdi:file-sync
set_action:
- lambda: if (tft_file_branch->active_index().has_value()) id(tft_branch) = tft_file_branch->active_index().value();
- script.execute: set_tft_file
- lambda: |-
if (tft_file_branch->active_index().has_value()) id(tft_branch) = tft_file_branch->active_index().value();
set_tft_file->execute();
sensor:
- id: !extend display_mode