diff --git a/ReleaseNotes.md b/ReleaseNotes.md index cee6dc8..c95cf38 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -19,9 +19,9 @@ So at this release we concentrated on cleaning up de code everywhere and shave s Since in this update lots of input to the blueprint changed, we highly recommend you review your settings and make sure all fields have the correct selection. We did our best to support your legacy settings and avoid breaking your system, but please double check your settings if you see something not working as expected. ### Files that need to be reloaded: -1. nspanel_eu.tft, nspanel_us.tft or nspanel_us_land.tft - v4.1.2 -2. nspanel_esphome.yaml - v4.1.2 -3. nspanel_blueprint.yaml - v4.1.2 +1. nspanel_eu.tft, nspanel_us.tft or nspanel_us_land.tft - v4.1.4 +2. nspanel_esphome.yaml - v4.1.4 +3. nspanel_blueprint.yaml - v4.1.4 #### @@ -103,6 +103,10 @@ packages: - Upload TFT remove dependency to from ESPHome Nextion component - Fix light icon color on buttons - Fix climate page not updating properly +- 4.1.4 patch: + - Supports new `weather.get_forecasts` introduced by Home Assistant 2023.12.0 + - Manual line break on multiline text with `\r` +   ## Details of noteworthy changes diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 310252d..a220416 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -1,6 +1,9 @@ -############################################################# -##### START - INPUT ##### -############################################################# +####################################################################################################### +##### NSPANEL Blueprint created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### Blueprint ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +####################################################################################################### blueprint: name: NSPanel Configuration @@ -33,7 +36,7 @@ blueprint: 🎉 Roadmap can be found here: [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) - ℹ️ Version: v4.1.3 + ℹ️ Version: v4.1.4 source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3599,7 +3602,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.1.3' + blueprint_version: '4.1.4' date_format_temp: !input 'date_format' #Avoid breaking change for existing users with legacy type format date_format: > @@ -8581,7 +8584,14 @@ action: - *delay-default ##### Display weather data only when available ##### - - service: weather.get_forecast + - variables: + ha_core_update_entity: > + {% for u in integration_entities("hassio") | select("search", "^update[.]") if (device_attr(u, "identifiers") | first)[1] == "core" %} + {{ u }} + {% endfor %} + ha_core_current_version: '{{ state_attr(ha_core_update_entity, "installed_version") }}' + use_new_forecasts: '{{ ha_core_current_version | version >= "2023.12.0b1" if ha_core_current_version else false }}' + - service: '{{ "weather.get_forecasts" if use_new_forecasts else "weather.get_forecast" }}' target: entity_id: '{{ weather_entity }}' data: @@ -8590,11 +8600,13 @@ action: continue_on_error: true - variables: forecast: > - {{ - service_response_var.forecast - if service_response_var is defined and service_response_var.forecast is defined - else state_attr(weather_entity, "forecast") | default(false) - }} + {% if use_new_forecasts and service_response_var is defined and service_response_var[weather_entity] is defined and service_response_var[weather_entity].forecast is defined %} + {{ service_response_var[weather_entity].forecast }} + {% elif service_response_var is defined and service_response_var.forecast is defined %} + {{ service_response_var.forecast }} + {% else %} + {{ state_attr(weather_entity, "forecast") | default(false) }} + {% endif %} - condition: '{{ forecast != false }}' - variables: datetime_is_string: '{{ forecast[0] is defined and forecast[0]["datetime"] is string }}' diff --git a/nspanel_esphome_addon_climate_base.yaml b/nspanel_esphome_addon_climate_base.yaml index 2bf121d..7c6e514 100644 --- a/nspanel_esphome_addon_climate_base.yaml +++ b/nspanel_esphome_addon_climate_base.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Shared - This will be called by heat/cool ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Shared - This will be called by heat/cool ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_climate_cool.yaml b/nspanel_esphome_addon_climate_cool.yaml index a61fbbc..f887e45 100644 --- a/nspanel_esphome_addon_climate_cool.yaml +++ b/nspanel_esphome_addon_climate_cool.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Cool ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Cool ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_climate_heat.yaml b/nspanel_esphome_addon_climate_heat.yaml index 4c7ddc3..eab575d 100644 --- a/nspanel_esphome_addon_climate_heat.yaml +++ b/nspanel_esphome_addon_climate_heat.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Heat ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Heat ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_upload_tft.yaml b/nspanel_esphome_addon_upload_tft.yaml index 5158756..2f149ae 100644 --- a/nspanel_esphome_addon_upload_tft.yaml +++ b/nspanel_esphome_addon_upload_tft.yaml @@ -4,6 +4,8 @@ ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### +##### ATTENTION: This will add advanced elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: diff --git a/nspanel_esphome_advanced.yaml b/nspanel_esphome_advanced.yaml index dfb2e06..d0b0ab1 100644 --- a/nspanel_esphome_advanced.yaml +++ b/nspanel_esphome_advanced.yaml @@ -1,6 +1,6 @@ ##################################################################################################### ##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -##### ADVANCED CONFIG + FULL ESPHOME CODE! ##### +##### ESPHOME ADVANCED ##### ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index 9959780..a1d4bc2 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -1,13 +1,13 @@ ##################################################################################################### ##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -##### ADVANCED CONFIG + FULL ESPHOME CODE! ##### +##### ESPHOME CORE ##### ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### substitutions: ##### DON'T CHANGE THIS ##### - version: "4.1.3" + version: "4.1.4" ############################# #external_components: @@ -2094,23 +2094,27 @@ script: int startPos = 0; int endPos = 0; std::string wrappedText = ""; - while (startPos < text_to_display.length()) { - while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } - int endPos = startPos + line_length_limit; - if (endPos >= text_to_display.length()) endPos = text_to_display.length(); - else - { - while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; } - if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word - } - wrappedText += text_to_display.substr(startPos, endPos-startPos); - if (endPos < text_to_display.length()) - { - while (text_to_display[endPos] == ' ') { endPos--; } - if (endPos >= startPos) wrappedText += "\\r"; - } - startPos = endPos + 1; // Skip the space - while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + if (text_to_display.find("\\r") != std::string::npos) { + wrappedText = text_to_display; + } else { + while (startPos < text_to_display.length()) { + while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + int endPos = startPos + line_length_limit; + if (endPos >= text_to_display.length()) endPos = text_to_display.length(); + else + { + while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; } + if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word + } + wrappedText += text_to_display.substr(startPos, endPos-startPos); + if (endPos < text_to_display.length()) + { + while (text_to_display[endPos] == ' ') { endPos--; } + if (endPos >= startPos) wrappedText += "\\r"; + } + startPos = endPos + 1; // Skip the space + while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + } } disp1->set_component_text_printf(component.c_str(), "%s", wrappedText.c_str()); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index e495a49..10243e1 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index d551324..0f72e61 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/boot.txt b/nspanel_eu_code/boot.txt index dab95f5..9f168f3 100644 --- a/nspanel_eu_code/boot.txt +++ b/nspanel_eu_code/boot.txt @@ -142,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1.3 + Text : 4.1.4 Max. Text Size : 9 Text esph_version diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 511511b..3f2975f 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 63e7e5e..069d2b7 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/boot.txt b/nspanel_us_code/boot.txt index dab95f5..9f168f3 100644 --- a/nspanel_us_code/boot.txt +++ b/nspanel_us_code/boot.txt @@ -142,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1.3 + Text : 4.1.4 Max. Text Size : 9 Text esph_version diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 21fbc40..ceccc36 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index 4be1c69..9cc1856 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/boot.txt b/nspanel_us_land_code/boot.txt index dab95f5..9f168f3 100644 --- a/nspanel_us_land_code/boot.txt +++ b/nspanel_us_land_code/boot.txt @@ -142,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1.3 + Text : 4.1.4 Max. Text Size : 9 Text esph_version