From 071a13076fae2cd14c3f0885302c4b83369a76a8 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:23:49 +0100 Subject: [PATCH] Prevents crash when climate can't provide `hvac_action` Probably solves #1649 --- ReleaseNotes.md | 2 +- nspanel_blueprint.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index c291ae4..ec429e7 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -67,7 +67,7 @@ We did our best to support your legacy settings and avoid breaking your system, bluetooth_proxy: # Set Wi-Fi power save mode to "LIGHT" as required for Bluetooth on ESP32 wifi: - power_save_mode: LIGHT + power_save_mode: LIGHT ##### My customization - End ##### ``` diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index bf24a54..b9dc812 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.2.2 + ℹ️ Version: v4.2.3dev source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3958,7 +3958,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.2.2' + blueprint_version: '4.2.3dev' date_format_temp: !input 'date_format' # Avoid breaking change for existing users with legacy type format date_format: > @@ -7339,7 +7339,7 @@ action: {{ all_icons[overlap.icon.split(":")[1]] | default(icon_domain) if overlap.icon.split(":") | count == 2 else overlap.icon }} {% elif entity_domain == "climate" %} {% set entity_hvac_action = state_attr(entity_id, "hvac_action") | default(None) %} - {% set entity_climate_action = (entity_hvac_action if entity_hvac_action not in enum.states.unknown else entity_state) %} + {% set entity_climate_action = (entity_hvac_action if entity_hvac_action and entity_hvac_action not in enum.states.unknown else entity_state) %} {% if "off" in entity_climate_action %}{{ all_icons.thermostat }} {% elif "heating" in entity_climate_action or "heat" in entity_climate_action %}{{ all_icons["thermometer-lines"] }} {% elif "cooling" in entity_climate_action or "cool" in entity_climate_action %}{{ all_icons.snowflake }} @@ -7382,7 +7382,7 @@ action: {% endif %} {% elif entity_domain == "climate" %} {% set entity_hvac_action = state_attr(entity_id, "hvac_action") | default(None) %} - {% set entity_climate_action = (entity_hvac_action if entity_hvac_action not in enum.states.unknown else entity_state) %} + {% set entity_climate_action = (entity_hvac_action if entity_hvac_action and entity_hvac_action not in enum.states.unknown else entity_state) %} {% if "off" in entity_climate_action %}{{ nextion.color.off }} {% elif "heating" in entity_climate_action or "heat" in entity_climate_action %}{{ nextion.color.deep_orange}} {% elif "cooling" in entity_climate_action or "cool" in entity_climate_action %}{{ nextion.color.blue }}