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_switch_on: "65"
button_cover_off: "66" button_cover_off: "66"
button_cover_on: "67" button_cover_on: "67"
hardware_button_pic_off: "115"
hardware_button_pic_on: "116"
cover_pic_closed: "78" cover_pic_closed: "78"
cover_pic_open: "79" cover_pic_open: "79"
battery_icon: "80" battery_icon: "80"
@@ -1044,6 +1046,19 @@ trigger:
value_template: '{{ states(right_button) is match "on" }}' value_template: '{{ states(right_button) is match "on" }}'
id: right_button_press 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
@@ -1878,21 +1893,59 @@ action:
data: data:
cmd: home.a05.pic={{ weather_pic }} cmd: home.a05.pic={{ weather_pic }}
##### NSPanel boot init - Left Button ##### ##### NSPanel boot init - Left Button Name #####
- delay: - if:
milliseconds: "{{ delay_value }}" - condition: template
- service: "{{ command_text_printf }}" value_template: '{{ left_button_name |length > 0 }}'
data: then:
component: home.left_bt_text - delay:
message: "{{ left_button_name }}" 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: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_printf }}"
data: data:
component: home.right_bt_text cmd: home.left_bt_pic.pic={{ left_hardware_button_state }}
message: "{{ right_button_name }}"
##### 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 ##### ##### NSPanel boot init finished #####
- delay: - delay:
@@ -2519,7 +2572,7 @@ action:
##### LAST_CLICK_LIGHTSETTINGS - Changes on page Light-Settings ##### DONE ##### LASTCLICK_LIGHTSETTINGS - Changes on page Light-Settings ##### DONE
- conditions: - conditions:
- condition: trigger - condition: trigger
id: light_settings 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: - conditions:
- condition: trigger - condition: trigger
id: cover_settings id: cover_settings
@@ -2672,6 +2725,29 @@ action:
{% endif %} {% endif %}
data: data:
entity_id: "{{ left_button_entity }}" 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 ##### Date and Time Home Page ##### DONE
- conditions: - conditions:
- condition: trigger - condition: trigger