From 6dcf47f4dbf7531c42d189d2f239a50763887ebe Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:34:23 +0100 Subject: [PATCH] Fix light icon color not being used for buttons Solves #1317 --- ReleaseNotes.md | 2 ++ nspanel_blueprint.yaml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index a42beef..7d67d73 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -90,6 +90,8 @@ packages: - Stop the fallback to Home page when Notification or Confirm pages are shown - Display current temperature on buttons even when climate is off - Buttons on both the Home and Buttons pages shows entity's icon when available +- 4.1.2 patch: + - Fix light icon color not being used for buttons   ## Details of noteworthy changes diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 001ee6c..34b0a8d 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -33,7 +33,7 @@ blueprint: 🎉 Roadmap can be found here: [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) - ℹ️ Version: v4.1.1 + ℹ️ Version: v4.1.2dev source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3604,7 +3604,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.1.1' + blueprint_version: '4.1.2dev' date_format_temp: !input 'date_format' #Avoid breaking change for existing users with legacy type format date_format: > @@ -7617,7 +7617,7 @@ action: {% elif item_domain in ["light"] %} {% set rgb_color = state_attr(repeat.item.entity, "rgb_color") | default(None) %} {% set brightness = (state_attr(repeat.item.entity, "brightness") | int(255))/255 %} - {% set icon_color_raw = rgb_color | list if rgb_color is sequence else (nextion.color.on if entity_state in enum.states.on else nextion.color.off) %} + {% set icon_color_raw = rgb_color | list if rgb_color is sequence else ((repeat.item.icon_color_rgb if repeat.item.icon_color_rgb is sequence else nextion.color.on) if entity_state in enum.states.on else nextion.color.off) %} {{ [ min(255,icon_color_raw[0] * brightness) | round(0),