From 9a1b447087d7394a8484008ff91f79e8afa93eb3 Mon Sep 17 00:00:00 2001 From: deejaybeam Date: Tue, 24 Jan 2023 00:21:12 +0100 Subject: [PATCH] upd: change qr-code-call --- nspanel_blueprint.yaml | 32 ++++++++++++++++---------------- nspanel_esphome.yaml | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index e61f874..591404b 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -2884,10 +2884,26 @@ action: id: open_qrcode_page - condition: template value_template: '{{ qrcode_state == true }}' + - condition: template + value_template: '{{ qrcode_value |length > 0 }}' sequence: - service: "{{ command_printf }}" data: cmd: "page {{ page_qrcode }}" + - if: + - condition: template + value_template: '{{ qrcode_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "qrcode_label" + message: "{{ qrcode_label }}" + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_text_printf }}" + data: + component: "qrcode_value" + message: "{{ qrcode_value }}" ##### Button Notification clear ##### - conditions: @@ -5940,22 +5956,6 @@ action: ## PAGE QR Code ## - conditions: '{{ trigger.event.data.new_state.state == page_qrcode }}' sequence: - ##### QR Code Page Label ##### - - if: - - condition: template - value_template: '{{ qrcode_label |length > 0 }}' - then: - - service: "{{ command_text_printf }}" - data: - component: "qrcode_label" - message: "{{ qrcode_label }}" - - delay: - milliseconds: "{{ delay_value }}" - - - service: "{{ command_text_printf }}" - data: - component: "qrcode_value" - message: "{{ qrcode_value }}" ##### Open Climate Settings ##### - conditions: diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 38ba39a..8205a86 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -246,6 +246,7 @@ api: - wait_until: switch.is_on: nextion_init - lambda: |- + id(disp1).send_command_printf("page qrcode"); id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str()); #### Service to send thermostat cycle state ####