Store TFT file to resist power cycle
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user