From 852ba630383d1c207b5353c14cf79d3e9bed0b46 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:26:00 +0100 Subject: [PATCH] Use pr5667 for Nextion --- nspanel_esphome_addon_upload_tft.yaml | 34 ++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/nspanel_esphome_addon_upload_tft.yaml b/nspanel_esphome_addon_upload_tft.yaml index 50d01e8..6373d43 100644 --- a/nspanel_esphome_addon_upload_tft.yaml +++ b/nspanel_esphome_addon_upload_tft.yaml @@ -18,19 +18,24 @@ substitutions: ############################# external_components: - - source: github://pr#3256 # adds esp-idf support to http_request - components: +# - source: github://pr#3256 # adds esp-idf support to http_request +# components: - http_request - - source: github://pr#5484 #5660 # adds exit reparse to Nextion library + - source: github://pr#5667 #5484 #5660 # adds exit reparse to Nextion library +# - source: +# type: git +# url: https://github.com/edwardtfn/esphome +# ref: nextion-esp-idf components: - nextion + refresh: 300s ##### HTTP REQUEST ##### # Enables http client # # for upload_tft. # ######################## -http_request: - id: httpclient +#http_request: +# id: httpclient button: ##### UPDATE TFT DISPLAY ##### @@ -69,21 +74,28 @@ api: state: false - lambda: 'id(upload_tft).execute(url.c_str());' -#display: -# - id: !extend disp1 -# tft_url: ${nextion_update_url} +display: + - id: !extend disp1 + tft_url: ${nextion_update_url} script: - - id: upload_tft_new + - id: upload_tft mode: single parameters: url: string then: - lambda: |- static const char *const TAG = "script.upload_tft"; - ESP_LOGD(TAG, "Starting..."); + ESP_LOGVV(TAG, "Starting..."); + ESP_LOGV(TAG, "Setting Nextion protocol reparse mode to passive"); + id(disp1).set_protocol_reparse_mode(false); + ESP_LOGV(TAG, "Setting TFT url: %s", url.c_str()); + id(disp1)->set_tft_url(url.c_str()); + ESP_LOGV(TAG, "Calling upload from Nextion component"); + id(disp1)->upload_tft(); + ESP_LOGVV(TAG, "Finished"); - - id: upload_tft + - id: upload_tft_working mode: single parameters: url: string