Use pr5667 for Nextion

This commit is contained in:
Edward Firmo
2023-11-03 15:26:00 +01:00
parent 58132cb189
commit 852ba63038

View File

@@ -18,19 +18,24 @@ substitutions:
############################# #############################
external_components: external_components:
- source: github://pr#3256 # adds esp-idf support to http_request # - source: github://pr#3256 # adds esp-idf support to http_request
components: # components:
- http_request - 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: components:
- nextion - nextion
refresh: 300s
##### HTTP REQUEST ##### ##### HTTP REQUEST #####
# Enables http client # # Enables http client #
# for upload_tft. # # for upload_tft. #
######################## ########################
http_request: #http_request:
id: httpclient # id: httpclient
button: button:
##### UPDATE TFT DISPLAY ##### ##### UPDATE TFT DISPLAY #####
@@ -69,21 +74,28 @@ api:
state: false state: false
- lambda: 'id(upload_tft).execute(url.c_str());' - lambda: 'id(upload_tft).execute(url.c_str());'
#display: display:
# - id: !extend disp1 - id: !extend disp1
# tft_url: ${nextion_update_url} tft_url: ${nextion_update_url}
script: script:
- id: upload_tft_new - id: upload_tft
mode: single mode: single
parameters: parameters:
url: string url: string
then: then:
- lambda: |- - lambda: |-
static const char *const TAG = "script.upload_tft"; 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 mode: single
parameters: parameters:
url: string url: string