Merge pull request #233 from deejaybeam/dev

QR-code, local fallback
This commit is contained in:
Chris
2023-01-24 01:08:38 +01:00
committed by GitHub
2 changed files with 55 additions and 16 deletions

View File

@@ -279,6 +279,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
default: [] default: []
selector: selector:
text: {} text: {}
relay_1_local_fallback:
name: Activate Relay 1 local Fallback (Optional)
default: false
description: '* *activate this to use left button to toggle relay 1 if display is offline* '
selector:
boolean:
right_button_entity: right_button_entity:
name: Right Button (Optional) name: Right Button (Optional)
description: '* *Right Hardware Button - Select the entity that should be switched*' description: '* *Right Hardware Button - Select the entity that should be switched*'
@@ -302,6 +308,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
default: [] default: []
selector: selector:
text: {} text: {}
relay_2_local_fallback:
name: Activate Relay 2 local Fallback (Optional)
default: false
description: '* *activate this to use right button to toggle relay 2 if display is offline* '
selector:
boolean:
##### BUTTON Page Labels ##### ##### BUTTON Page Labels #####
button_page01_label: button_page01_label:
@@ -1410,6 +1422,8 @@ variables:
qrcode_label: !input "qrcode_label" qrcode_label: !input "qrcode_label"
qrcode_value: !input "qrcode_value" qrcode_value: !input "qrcode_value"
qrcode_state: !input "qrcode_state" qrcode_state: !input "qrcode_state"
relay_1_local_fallback: !input "relay_1_local_fallback"
relay_2_local_fallback: !input "relay_2_local_fallback"
#### HARDWARE BUTTONS ##### #### HARDWARE BUTTONS #####
left_button_entity: !input "left_button_entity" left_button_entity: !input "left_button_entity"
@@ -2830,6 +2844,30 @@ action:
data: data:
song_str: "two short:d=4,o=5,b=100:16e6,16e6" song_str: "two short:d=4,o=5,b=100:16e6,16e6"
###### Set local fallback ######
- if:
- condition: template
value_template: '{{ relay_1_local_fallback }}'
then:
- service: switch.turn_on
data:
entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback'
else:
- service: switch.turn_off
data:
entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback'
- if:
- condition: template
value_template: '{{ relay_2_local_fallback }}'
then:
- service: switch.turn_on
data:
entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback'
else:
- service: switch.turn_off
data:
entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback'
##### NSPanel boot init finished and jump to Home Page##### ##### NSPanel boot init finished and jump to Home Page#####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
@@ -2884,10 +2922,26 @@ action:
id: open_qrcode_page id: open_qrcode_page
- condition: template - condition: template
value_template: '{{ qrcode_state == true }}' value_template: '{{ qrcode_state == true }}'
- condition: template
value_template: '{{ qrcode_value |length > 0 }}'
sequence: sequence:
- service: "{{ command_printf }}" - service: "{{ command_printf }}"
data: data:
cmd: "page {{ page_qrcode }}" 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 ##### ##### Button Notification clear #####
- conditions: - conditions:
@@ -5940,22 +5994,6 @@ action:
## PAGE QR Code ## ## PAGE QR Code ##
- conditions: '{{ trigger.event.data.new_state.state == page_qrcode }}' - conditions: '{{ trigger.event.data.new_state.state == page_qrcode }}'
sequence: 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 ##### ##### Open Climate Settings #####
- conditions: - conditions:

View File

@@ -246,6 +246,7 @@ api:
- wait_until: - wait_until:
switch.is_on: nextion_init switch.is_on: nextion_init
- lambda: |- - lambda: |-
id(disp1).send_command_printf("page qrcode");
id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str()); id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str());
#### Service to send thermostat cycle state #### #### Service to send thermostat cycle state ####