Improving watchdog

This commit is contained in:
Edward Firmo
2023-12-27 17:52:24 +01:00
parent 357572d401
commit c15179b215
2 changed files with 32 additions and 23 deletions

View File

@@ -41,21 +41,21 @@ api:
clean_url = clean_url.substr(0, endPos + 1);
}
if ( clean_url.empty() or clean_url == "default") url = tft_list->state;
if ( clean_url.empty() or clean_url == "default") url = tft_update_url->state;
upload_tft->execute(url.c_str());
button:
##### UPDATE TFT DISPLAY #####
- name: ${device_name} Update TFT display
- id: tft_update
name: ${device_name} Update TFT display
platform: template
icon: mdi:file-sync
id: tft_update
entity_category: config
on_press:
- lambda: |-
static const char *const TAG = "button.tft_update.on_press";
ESP_LOGD(TAG, "Update TFT display button pressed");
upload_tft->execute(tft_list->state.c_str());
upload_tft->execute(tft_update_url->state.c_str());
display:
- id: !extend disp1
@@ -1027,21 +1027,18 @@ script:
id(is_uploading_tft) = false;
ESP_LOGD(TAG, "Finished!");
select:
- id: tft_list
name: Update TFT display URL
text:
- id: tft_update_url
name: ${device_name} Update TFT URL
platform: template
options:
- "${nextion_update_url}"
- "${nextion_blank_url}"
initial_option: "${nextion_update_url}"
optimistic: true
restore_value: false
internal: false
icon: mdi:file-sync
entity_category: config
icon: mdi:file-arrow-up-down-outline
disabled_by_default: true
restore_value: true
initial_value: ${nextion_update_url}
mode: text
set_action:
- lambda: |-
static const char *const TAG = "select.tft_list.set_action";
ESP_LOGD(TAG, "Selected TFT URL: %s", x.c_str());
then:
- lambda: |-
static const char *const TAG = "text.tft_update_url.set_action";
ESP_LOGD(TAG, "Update TFT URL changed: %s", x.c_str());