From 627e0b63e722888a12f3c4c0dadebf7d540838d8 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:55:07 +0200 Subject: [PATCH] Customizations - Blank TFT button Probably solves #1048 --- docs/en/customization.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/en/customization.md b/docs/en/customization.md index 7331fbc..6b74742 100644 --- a/docs/en/customization.md +++ b/docs/en/customization.md @@ -189,4 +189,31 @@ binary_sensor: platform: template lambda: |- return (id(current_page).state == "screensaver"); +``` + +  +### Button to upload `nspanel_blank.tft` +This can also be used for any other`alternative `tft` file you might want to use frequently: + +```yaml +button: + ##### UPDATE TFT BLANK DISPLAY ##### + - name: ${device_name} Update TFT display (blank) + platform: template + icon: mdi:file-sync + id: tft_update_blank + entity_category: config + on_press: + - logger.log: "Button pressed: Update TFT display (blank)" + - binary_sensor.template.publish: + id: nextion_init + state: false + - delay: 16ms + - lambda: |- + id(disp1)->set_tft_url("${nextion_update_blank_url}"); + id(disp1).upload_tft(); +``` +You also must add the url for the alternative `tft` in your substitutions, like this: +```yaml + nextion_update_blank_url: "http://homeassistant.local:8123/local/nspanel/dev/nspanel_blank.tft" ``` \ No newline at end of file