From 8b4901b150ba1996182dc07a5fc9153b8cfeaa25 Mon Sep 17 00:00:00 2001 From: Blackymas Date: Wed, 9 Nov 2022 22:57:38 +0100 Subject: [PATCH] show and hide componente --- esphome.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/esphome.yaml b/esphome.yaml index b47f6ee..b225a53 100644 --- a/esphome.yaml +++ b/esphome.yaml @@ -157,14 +157,14 @@ api: then: - lambda: 'id(disp1)->upload_tft();' - ##### Service to send a command "printf" directly to the display. Useful for testing ##### + ##### Service to send a command "printf" directly to the display ##### - service: send_command_printf variables: cmd: string then: - lambda: 'id(disp1).send_command_printf("%s", cmd.c_str());' - ##### Service to send a command "text_printf" directly to the display. Useful for testing ##### + ##### Service to send a command "text_printf" directly to the display ##### - service: send_command_text_printf variables: component: string @@ -174,7 +174,7 @@ api: switch.is_on: nextion_init - lambda: 'id(disp1).set_component_text_printf(component.c_str(), "%s", message.c_str());' - ##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing ##### + ##### Service to send a command "component_value (Dualstate Button)" directly to the display ##### - service: send_command_value variables: component: string @@ -184,7 +184,7 @@ api: switch.is_on: nextion_init - lambda: 'id(disp1).set_component_value(component.c_str(), message);' - ##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing ##### + ##### Service to send a command "hide componente" directly to the display ##### - service: send_command_hide variables: component: string @@ -193,7 +193,16 @@ api: switch.is_on: nextion_init - lambda: 'id(disp1).hide_component(component.c_str());' - ##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing ##### + ##### Service to send a command "show componente" directly to the display ##### + - service: send_command_show + variables: + component: string + then: + - wait_until: + switch.is_on: nextion_init + - lambda: 'id(disp1).show_component(component.c_str());' + + ##### Service to send a command "font color" directly to the display ##### - service: send_command_font_color variables: component: string @@ -202,7 +211,7 @@ api: - wait_until: switch.is_on: nextion_init - lambda: 'id(disp1).set_component_font_color(component.c_str(), message);' - ##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing ##### + ##### Service to send a command "background color" directly to the display ##### - service: send_command_background_color variables: component: string