From a6f62a053c4c1b0fddc57e900b4b32b69c1a49f7 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:03:20 +0200 Subject: [PATCH] Use `send_command` from Nextion --- esphome/nspanel_esphome_core.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index fb479e6..3b5922b 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -233,7 +233,7 @@ api: then: - lambda: |- if (!id(is_uploading_tft)) - disp1->send_command_printf("%s", cmd.c_str()); + disp1->send_command(cmd.c_str()); # Changes the foreground color of a specified component on the display. - service: component_color @@ -769,7 +769,7 @@ api: set_component_visibility->execute("time_total", true); set_component_visibility->execute("time_progress", true); } else { - disp1->send_command_printf("prg_timer.en=0"); + disp1->send_command("prg_timer.en=0"); set_component_visibility->execute("time_current", false); set_component_visibility->execute("time_total", false); set_component_visibility->execute("time_progress", false); @@ -2035,7 +2035,7 @@ script: disp1->set_component_value("boot.progress", step); } if (current_page->state == "boot" and !isnan(display_charset->state) and !isnan(display_mode->state) and !version_tft->state.empty()) - disp1->send_command_printf("tm_esphome.en=0"); + disp1->send_command("tm_esphome.en=0"); - id: change_climate_state mode: restart @@ -2262,7 +2262,7 @@ script: #elif defined(USE_ESP_IDF) disp1->set_component_text("framework", "ESP-IDF"); #endif - disp1->send_command_printf("tm_esphome.en=0"); + disp1->send_command("tm_esphome.en=0"); - id: page_boot mode: single @@ -2418,7 +2418,7 @@ script: current_page->state != "confirm" && current_page->state != "keyb_num") { detailed_entity->publish_state(""); - disp1->send_command_printf("back_page_id=1"); + disp1->send_command("back_page_id=1"); } if (current_page->state != "media_player") { id(last_volume_level) = 0; @@ -2812,7 +2812,7 @@ script: - lambda: |- if (!id(is_uploading_tft)) { if (brightness == display_brightness->state and current_page->state != "boot" and current_page->state != "screensaver") - disp1->send_command_printf("wakeup_timer.en=1"); + disp1->send_command("wakeup_timer.en=1"); else disp1->set_backlight_brightness(brightness / 100.0f); current_brightness->update();