Store TFT file to resist power cycle
This commit is contained in:
@@ -213,6 +213,7 @@ script:
|
|||||||
- id: set_tft_file
|
- id: set_tft_file
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
|
- delay: 2s
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
static const char *const TAG = "addon_upload_tft.script.set_tft_file";
|
static const char *const TAG = "addon_upload_tft.script.set_tft_file";
|
||||||
std::string model = tft_file_model->state;
|
std::string model = tft_file_model->state;
|
||||||
@@ -1239,8 +1240,9 @@ select:
|
|||||||
disabled_by_default: false
|
disabled_by_default: false
|
||||||
icon: mdi:file-sync
|
icon: mdi:file-sync
|
||||||
set_action:
|
set_action:
|
||||||
- lambda: if (tft_file_model->active_index().has_value()) id(tft_model) = tft_file_model->active_index().value();
|
- lambda: |-
|
||||||
- script.execute: set_tft_file
|
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
|
- id: tft_file_branch
|
||||||
name: ${device_name} Update TFT display - Branch
|
name: ${device_name} Update TFT display - Branch
|
||||||
@@ -1257,8 +1259,9 @@ select:
|
|||||||
disabled_by_default: true
|
disabled_by_default: true
|
||||||
icon: mdi:file-sync
|
icon: mdi:file-sync
|
||||||
set_action:
|
set_action:
|
||||||
- lambda: if (tft_file_branch->active_index().has_value()) id(tft_branch) = tft_file_branch->active_index().value();
|
- lambda: |-
|
||||||
- script.execute: set_tft_file
|
if (tft_file_branch->active_index().has_value()) id(tft_branch) = tft_file_branch->active_index().value();
|
||||||
|
set_tft_file->execute();
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- id: !extend display_mode
|
- id: !extend display_mode
|
||||||
|
|||||||
Reference in New Issue
Block a user