From 649c89188136ade78be5f9b34a4d41f92b4d08e3 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 10 Nov 2023 09:48:27 +0100 Subject: [PATCH] Remove service `show_all` To clean-up a bit the list of services. --- nspanel_blueprint.yaml | 13 +++-- nspanel_esphome_core.yaml | 99 +++++++++++++++++++-------------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index a275be6..5697849 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3659,7 +3659,6 @@ variables: set_component_color: 'esphome.{{ nspanel_name }}_set_component_color' set_entity: 'esphome.{{ nspanel_name }}_set_entity' show: 'esphome.{{ nspanel_name }}_send_command_show' - show_all: 'esphome.{{ nspanel_name }}_send_command_show_all' text_printf: 'esphome.{{ nspanel_name }}_send_command_text_printf' tft_upload: 'esphome.{{ nspanel_name }}_upload_tft' value: 'esphome.{{ nspanel_name }}_send_command_value' @@ -7574,7 +7573,9 @@ action: - if: '{{ show_while_loading }}' then: - *delay-default - - service: '{{ nextion.command.show_all }}' + - service: '{{ nextion.command.show }}' + data: + component: '255' #all continue_on_error: true ##### NSPanel build Button page ##### @@ -7728,12 +7729,16 @@ action: - if: '{{ not show_while_loading }}' then: - *delay-default - - service: '{{ nextion.command.show_all }}' + - service: '{{ nextion.command.show }}' + data: + component: '255' #all continue_on_error: true else: ###### Show empty page ##### - *delay-default - - service: '{{ nextion.command.show_all }}' + - service: '{{ nextion.command.show }}' + data: + component: '255' #all continue_on_error: true ## PAGE LIGHT ## diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index 78de8a1..81e22a6 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -120,6 +120,53 @@ api: id: api_server reboot_timeout: 0s services: + ##### Service to send a command "printf" directly to the display ##### + - service: send_command_printf + variables: + cmd: string + then: + - lambda: 'disp1->send_command_printf("%s", cmd.c_str());' + + ##### Service to send a command "text_printf" directly to the display ##### + - service: send_command_text_printf + variables: + component: string + message: string + then: + - lambda: '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 ##### + - service: send_command_value + variables: + component: string + val: int + then: + - lambda: |- + disp1->set_component_value(component.c_str(), val); + + ##### Service to send a command "hide componente" directly to the display ##### + - service: send_command_hide ### unused ### + variables: + component: string + then: + - lambda: 'disp1->hide_component(component.c_str());' + + ##### Service to send a command "show componente" directly to the display ##### + - service: send_command_show ### unused ### + variables: + component: string + then: + - lambda: 'disp1->show_component(component.c_str());' + + ##### Service to send a command "font color" directly to the display ##### + - service: set_component_color + variables: + component: string + foreground: int[] + background: int[] + then: + - lambda: set_component_color->execute(component, foreground, background); + #### Service to populate the alarm settings page ##### - service: alarm_settings variables: @@ -308,58 +355,6 @@ api: disp1->goto_page(wakeup_page_name->state.c_str()); timer_reset_all->execute(wakeup_page_name->state.c_str()); - ##### Service to send a command "printf" directly to the display ##### - - service: send_command_printf - variables: - cmd: string - then: - - lambda: 'disp1->send_command_printf("%s", cmd.c_str());' - - ##### Service to send a command "text_printf" directly to the display ##### - - service: send_command_text_printf - variables: - component: string - message: string - then: - - lambda: '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 ##### - - service: send_command_value - variables: - component: string - val: int - then: - - lambda: |- - disp1->set_component_value(component.c_str(), val); - - ##### Service to send a command "hide componente" directly to the display ##### - - service: send_command_hide ### unused ### - variables: - component: string - then: - - lambda: 'disp1->hide_component(component.c_str());' - - ##### Service to send a command "show componente" directly to the display ##### - - service: send_command_show ### unused ### - variables: - component: string - then: - - lambda: 'disp1->show_component(component.c_str());' - - ##### Service to send a command "show ALL componente" directly to the display ##### - - service: send_command_show_all ### unused ### - then: - - lambda: disp1->show_component("255"); - - ##### Service to send a command "font color" directly to the display ##### - - service: set_component_color - variables: - component: string - foreground: int[] - background: int[] - then: - - lambda: set_component_color->execute(component, foreground, background); - ##### Service to show a notification-message on the screen ##### - service: notification_show variables: