From 860f5ddbba9e1586711a93d47d9a69af83540ea5 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 22 Mar 2023 20:28:01 +0100 Subject: [PATCH] Fix for slow response with "Loading..." - Fix the error where a missing/invalid entity causes the panel to slow down when opening a new page or keeps with "Loading..." on the screen until it timeouts. This will probably fix #493 --- nspanel_blueprint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index dd1b88a..37a24d4 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -5184,7 +5184,7 @@ action: then: - variables: ### component_to_update: "{{ repeat.item.button }}" - current_entity_state: "{{ states[repeat.item.entity].state }}" + current_entity_state: "{{ states(repeat.item.entity) }}" # Button PIC GRAY/WHITE btn_pic: >- {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }} @@ -5435,7 +5435,7 @@ action: then: - variables: ### component_to_update: "{{ repeat.item.button }}" - current_entity_state: "{{ states[repeat.item.entity].state }}" + current_entity_state: "{{ states(repeat.item.entity) }}" # Button PIC GRAY/WHITE btn_pic: >- {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }} @@ -5686,7 +5686,7 @@ action: then: - variables: ### component_to_update: "{{ repeat.item.button }}" - current_entity_state: "{{ states[repeat.item.entity].state }}" + current_entity_state: "{{ states(repeat.item.entity) }}" # Button PIC GRAY/WHITE btn_pic: >- {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }} @@ -5937,7 +5937,7 @@ action: then: - variables: ### component_to_update: "{{ repeat.item.button }}" - current_entity_state: "{{ states[repeat.item.entity].state }}" + current_entity_state: "{{ states(repeat.item.entity) }}" # Button PIC GRAY/WHITE btn_pic: >- {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }}