rdy - hardware button label and pic

This commit is contained in:
Blackymas
2022-11-08 15:58:27 +01:00
parent c201e76f64
commit e8642b83d0

View File

@@ -776,6 +776,8 @@ variables:
button_switch_on: "65"
button_cover_off: "66"
button_cover_on: "67"
hardware_button_pic_off: "115"
hardware_button_pic_on: "116"
cover_pic_closed: "78"
cover_pic_open: "79"
battery_icon: "80"
@@ -1044,6 +1046,19 @@ trigger:
value_template: '{{ states(right_button) is match "on" }}'
id: right_button_press
##### Left Button - State "left_button_state" #####
- platform: event
event_type: state_changed
event_data:
entity_id: !input "left_button_entity"
id: left_button_state
##### Right Button - State "right_button_state" #####
- platform: event
event_type: state_changed
event_data:
entity_id: !input "right_button_entity"
id: right_button_state
@@ -1053,7 +1068,7 @@ trigger:
- platform: template
value_template: '{{ states(last_click) is match "releasebutton" }}'
id: short_press
##### Page Button - Trigger "long_press" - LONG Press via "last_click" - Button LONG Press for jump to Lightsetting or Coversetting Page #####
- platform: template
value_template: '{{ states(last_click) is match "press" }}'
@@ -1878,21 +1893,59 @@ action:
data:
cmd: home.a05.pic={{ weather_pic }}
##### NSPanel boot init - Left Button #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: home.left_bt_text
message: "{{ left_button_name }}"
##### NSPanel boot init - Left Button Name #####
- if:
- condition: template
value_template: '{{ left_button_name |length > 0 }}'
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: home.left_bt_text
message: "{{ left_button_name }}"
##### NSPanel boot init - Left Button #####
##### SET Left Hardware Button PIC on Home Page ####
- variables:
# Hardware Button PIC
left_hardware_button_state: >-
{%- if states(left_button_entity) == 'off' -%} {{ hardware_button_pic_off }}
{%- elif states(left_button_entity) == 'on' -%} {{ hardware_button_pic_on }}
{%- endif -%}
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
- service: "{{ command_printf }}"
data:
component: home.right_bt_text
message: "{{ right_button_name }}"
cmd: home.left_bt_pic.pic={{ left_hardware_button_state }}
##### NSPanel boot init - Right Button Name #####
- if:
- condition: template
value_template: '{{ right_button_name |length > 0 }}'
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: home.right_bt_text
message: "{{ right_button_name }}"
###### SET Right Hardware Button PIC on Home Page #####
- variables:
# Hardware Button PIC
right_hardware_button_state: >-
{%- if states(right_button_entity) == 'off' -%} {{ hardware_button_pic_off }}
{%- elif states(right_button_entity) == 'on' -%} {{ hardware_button_pic_on }}
{%- endif -%}
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}
##### NSPanel boot init finished #####
- delay:
@@ -2519,7 +2572,7 @@ action:
##### LAST_CLICK_LIGHTSETTINGS - Changes on page Light-Settings ##### DONE
##### LASTCLICK_LIGHTSETTINGS - Changes on page Light-Settings ##### DONE
- conditions:
- condition: trigger
id: light_settings
@@ -2590,7 +2643,7 @@ action:
##### LAST_CLICK_COVERSETTINGS - Changes on page Cover-Settings ##### DONE
##### LASTCLICK_COVERSETTINGS - Changes on page Cover-Settings ##### DONE
- conditions:
- condition: trigger
id: cover_settings
@@ -2672,6 +2725,29 @@ action:
{% endif %}
data:
entity_id: "{{ left_button_entity }}"
- delay:
milliseconds: "{{ delay_value }}"
##### Left button State ##### DONE
- conditions:
- condition: trigger
id: left_button_state
sequence:
###### Left Hardware Button PIC #####
- variables:
# Hardware Button PIC
left_hardware_button_state: >-
{%- if states(left_button_entity) == 'off' -%} {{ hardware_button_pic_off }}
{%- elif states(left_button_entity) == 'on' -%} {{ hardware_button_pic_on }}
{%- endif -%}
##### SET Right hardware Button PIC on Home Page ####
- service: "{{ command_printf }}"
data:
cmd: home.left_bt_pic.pic={{ left_hardware_button_state }}
@@ -2695,6 +2771,27 @@ action:
##### Right button State ##### DONE
- conditions:
- condition: trigger
id: right_button_state
sequence:
###### Left Hardware Button PIC #####
- variables:
# Hardware Button PIC
right_hardware_button_state: >-
{%- if states(right_button_entity) == 'off' -%} {{ hardware_button_pic_off }}
{%- elif states(right_button_entity) == 'on' -%} {{ hardware_button_pic_on }}
{%- endif -%}
##### SET Right hardware Button PIC on Home Page ####
- service: "{{ command_printf }}"
data:
cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}
##### Date and Time Home Page ##### DONE
- conditions:
- condition: trigger