Fix issue with light settings page opening with 0%
This commit is contained in:
@@ -4675,7 +4675,15 @@ action:
|
|||||||
if settings_entity_state is mapping
|
if settings_entity_state is mapping
|
||||||
else { "page": "home", "entity": "unknown" }
|
else { "page": "home", "entity": "unknown" }
|
||||||
}}
|
}}
|
||||||
settings_entity_domain: '{{ settings_entity_dict.entity.split(".")[0] if settings_entity_dict.entity is defined and settings_entity_dict.entity is string and settings_entity_dict.entity.split(".") | count > 0 else "unknown" }}'
|
settings_entity_domain: >
|
||||||
|
{{
|
||||||
|
settings_entity_dict.entity.split(".")[0]
|
||||||
|
if
|
||||||
|
settings_entity_dict.entity is defined and
|
||||||
|
settings_entity_dict.entity is string and
|
||||||
|
settings_entity_dict.entity.split(".") | count > 0
|
||||||
|
else "unknown"
|
||||||
|
}}
|
||||||
- if: '{{ settings_entity_domain in ["light", "cover", "climate"] }}'
|
- if: '{{ settings_entity_domain in ["light", "cover", "climate"] }}'
|
||||||
then:
|
then:
|
||||||
- service: '{{ nextion.commands.printf }}'
|
- service: '{{ nextion.commands.printf }}'
|
||||||
@@ -5790,7 +5798,7 @@ action:
|
|||||||
continue_on_error: true
|
continue_on_error: true
|
||||||
##### LIGHT State #####
|
##### LIGHT State #####
|
||||||
- variables:
|
- variables:
|
||||||
curr_brightness: '{{ (state_attr(settings_entity_dict, "brightness") | int(0) * 100 / 255) | round(0) }}'
|
curr_brightness: '{{ (state_attr(settings_entity_dict.entity, "brightness") | int(0) * 100 / 255) | round(0) }}'
|
||||||
- *delay-default
|
- *delay-default
|
||||||
- service: '{{ nextion.commands.value }}'
|
- service: '{{ nextion.commands.value }}'
|
||||||
data:
|
data:
|
||||||
@@ -5812,7 +5820,7 @@ action:
|
|||||||
|
|
||||||
##### LIGHT Check Color_Temp Value is available when yes send some current Values #####
|
##### LIGHT Check Color_Temp Value is available when yes send some current Values #####
|
||||||
- variables:
|
- variables:
|
||||||
curr_color_temp: '{{ state_attr(settings_entity_dict, "color_temp") }}'
|
curr_color_temp: '{{ state_attr(settings_entity_dict.entity, "color_temp") }}'
|
||||||
- condition: '{{ is_number(curr_color_temp) }}'
|
- condition: '{{ is_number(curr_color_temp) }}'
|
||||||
- *delay-default
|
- *delay-default
|
||||||
- service: '{{ nextion.commands.text_printf }}'
|
- service: '{{ nextion.commands.text_printf }}'
|
||||||
|
|||||||
Reference in New Issue
Block a user