Fix position of values on page home (#661)
Fix error where values in the page home could be assigned to another component if a previous component have a state unknown or unavailable.
This commit is contained in:
@@ -3988,33 +3988,43 @@ action:
|
||||
- entity: "{{ relay01_entity }}"
|
||||
icon: !input "relay01_icon" #E3A5
|
||||
icon_color_rgb: !input "relay01_icon_color"
|
||||
component: home.icon_top_01
|
||||
- entity: "{{ relay02_entity }}"
|
||||
icon: !input "relay02_icon" #E3A8
|
||||
icon_color_rgb: !input "relay02_icon_color"
|
||||
component: home.icon_top_02
|
||||
- entity: "{{ climate }}"
|
||||
icon: "{{ (heat_icon if climate_action == 'heating' else thermostat_icon) if climate_state == 'heat' else nextion.icons.blank }}"
|
||||
icon_color_rgb: !input "thermostat_icon_color"
|
||||
component: home.icon_top_03
|
||||
- entity: !input "chip01"
|
||||
icon: !input "chip01_icon"
|
||||
icon_color_rgb: !input "chip01_icon_color"
|
||||
component: home.icon_top_04
|
||||
- entity: !input "chip02"
|
||||
icon: !input "chip02_icon"
|
||||
icon_color_rgb: !input "chip02_icon_color"
|
||||
component: home.icon_top_05
|
||||
- entity: !input "chip03"
|
||||
icon: !input "chip03_icon"
|
||||
icon_color_rgb: !input "chip03_icon_color"
|
||||
component: home.icon_top_06
|
||||
- entity: !input "chip04"
|
||||
icon: !input "chip04_icon"
|
||||
icon_color_rgb: !input "chip04_icon_color"
|
||||
component: home.icon_top_07
|
||||
- entity: !input "chip05"
|
||||
icon: !input "chip05_icon"
|
||||
icon_color_rgb: !input "chip05_icon_color"
|
||||
component: home.icon_top_08
|
||||
- entity: !input "chip06"
|
||||
icon: !input "chip06_icon"
|
||||
icon_color_rgb: !input "chip06_icon_color"
|
||||
component: home.icon_top_09
|
||||
- entity: !input "chip07"
|
||||
icon: !input "chip07_icon"
|
||||
icon_color_rgb: !input "chip07_icon_color"
|
||||
component: home.icon_top_10
|
||||
- repeat:
|
||||
for_each: "{{ home_page_status_bar }}"
|
||||
sequence:
|
||||
@@ -4030,14 +4040,14 @@ action:
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.font_color }}"
|
||||
data:
|
||||
component: "{{ 'home.icon_top_%02d' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}"
|
||||
message: "{{ repeat.item.icon_color_rgb if is_number(repeat.item.icon_color_rgb) else ((repeat.item.icon_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.icon_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.icon_color_rgb[2] //(2**3)) }}"
|
||||
continue_on_error: true
|
||||
### ICON Font ###
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.text_printf }}"
|
||||
data:
|
||||
component: "{{ 'home.icon_top_%02d' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}"
|
||||
message: "{{ repeat.item.icon if repeat_item_state_is_on else nextion.icons.blank }}"
|
||||
continue_on_error: true
|
||||
# {{ is_state(repeat.item.entity, 'on') | default(False) if repeat.item.entity is string else 'unavailable' }}
|
||||
@@ -4051,14 +4061,17 @@ action:
|
||||
icon: !input "home_value01_icon"
|
||||
icon_color_rgb: !input "home_value01_icon_color"
|
||||
label_color_rgb: !input "home_value01_label_color"
|
||||
component: home.value01
|
||||
- entity: !input "home_value02"
|
||||
icon: !input "home_value02_icon"
|
||||
icon_color_rgb: !input "home_value02_icon_color"
|
||||
label_color_rgb: !input "home_value02_label_color"
|
||||
component: home.value02
|
||||
- entity: !input "home_value03"
|
||||
icon: !input "home_value03_icon"
|
||||
icon_color_rgb: !input "home_value03_icon_color"
|
||||
label_color_rgb: !input "home_value03_label_color"
|
||||
component: home.value03
|
||||
- repeat:
|
||||
for_each: "{{ home_page_values }}"
|
||||
sequence:
|
||||
@@ -4071,14 +4084,14 @@ action:
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.font_color }}"
|
||||
data:
|
||||
component: "{{ 'home.value%02d_icon' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}_icon"
|
||||
message: "{{ repeat.item.icon_color_rgb if is_number(repeat.item.icon_color_rgb) else ((repeat.item.icon_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.icon_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.icon_color_rgb[2] //(2**3)) }}"
|
||||
continue_on_error: true
|
||||
### ICON Font ###
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.text_printf }}"
|
||||
data:
|
||||
component: "{{ 'home.value%02d_icon' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}_icon"
|
||||
message: "{{ repeat.item.icon }}"
|
||||
continue_on_error: true
|
||||
- variables:
|
||||
@@ -4090,14 +4103,14 @@ action:
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.font_color }}"
|
||||
data:
|
||||
component: "{{ 'home.value%02d_state' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}_state"
|
||||
message: "{{ repeat.item.label_color_rgb if is_number(repeat.item.label_color_rgb) else ((repeat.item.label_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.label_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.label_color_rgb[2] //(2**3)) }}"
|
||||
continue_on_error: true
|
||||
### LABEL Font ###
|
||||
- *delay-default
|
||||
- service: "{{ nextion.commands.text_printf }}"
|
||||
data:
|
||||
component: "{{ 'home.value%02d_state' | format(repeat.index) }}"
|
||||
component: "{{ repeat.item.component }}_state"
|
||||
message: "{{ (repeat_item_state | round(1) ~ state_attr(repeat.item.entity, 'unit_of_measurement') | default('')) if is_number(repeat_item_state) else repeat_item_state }}"
|
||||
continue_on_error: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user