From 03d1aa477c6f840819709cb38879f89c8fd4bde8 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 11 Jan 2024 01:32:20 +0100 Subject: [PATCH] Fix crash when light doesn't provide attribute `rgb_color` Solves #1584 Solves #1585 --- advanced/esphome/nspanel_esphome_core.yaml | 2 +- nspanel_blueprint.yaml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/advanced/esphome/nspanel_esphome_core.yaml b/advanced/esphome/nspanel_esphome_core.yaml index d372ba1..8e7dd56 100644 --- a/advanced/esphome/nspanel_esphome_core.yaml +++ b/advanced/esphome/nspanel_esphome_core.yaml @@ -14,7 +14,7 @@ substitutions: ota_password: ${wifi_password} ap_password: ${wifi_password} ##### DON'T CHANGE THIS ###### - version: "4.2beta.6" + version: "4.2beta.7" ############################## ##### External components ##### diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 5750b9b..9117b1b 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -37,7 +37,7 @@ blueprint: 🎉 Roadmap can be found here: [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) - ℹ️ Version: v4.2beta.6 + ℹ️ Version: v4.2beta.7 source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3928,7 +3928,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.2beta.6' + blueprint_version: '4.2beta.7' date_format_temp: !input 'date_format' # Avoid breaking change for existing users with legacy type format date_format: > @@ -7365,9 +7365,11 @@ action: min(255,entity_rgb_color[1] * entity_brightness_index) | round(0), min(255,entity_rgb_color[2] * entity_brightness_index) | round(0) ] + if entity_rgb_color is sequence and entity_rgb_color | count == 3 + else [ entity_rgb_color ] }} {% endif %} - {% else %}{{ entity_icon_color }} + {% else %}{{ entity_icon_color if entity_rgb_color is sequence else [ entity_icon_color ] }} {% endif %} - alias: Main choices