From 985d6b51617575e54abb32941cbabf193c9e636e Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:03:20 +0200 Subject: [PATCH] Fix invalid call to `page` var --- nspanel_esphome.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 8a1c145..e4eaea5 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -1136,6 +1136,7 @@ text_sensor: // Report new page to Home Assistant ESP_LOGV("text_sensor.localevent", "Trigger HA event"); + auto ha_event = new esphome::api::CustomAPIDevice(); ha_event->fire_homeassistant_event("esphome.nspanel_ha_blueprint", { {"type", "page_changed"}, @@ -1145,7 +1146,7 @@ text_sensor: // Report new page to add-ons ESP_LOGV("text_sensor.localevent", "Call add-ons scripts for new page"); - id(addon_climate_set_climate).execute(page=="climate" and id(entity_id) == "embedded_climate"); + id(addon_climate_set_climate).execute(x=="climate" and id(entity_id) == "embedded_climate"); // Construct new page ESP_LOGV("text_sensor.localevent", "Construct new page"); @@ -2375,14 +2376,6 @@ script: send_nextion_command("rest"); delay(1500); } - else - { - ESP_LOGD("script.upload_tft.upload_end_", "Turn off Nextion"); - //id(screen_power).turn_off(); - delay(1500); - ESP_LOGD("script.upload_tft.upload_end_", "Restarting esphome"); - ESP.restart(); - } return not retry; };