Skip to content

Commit

Permalink
Merge pull request #1648 from Blackymas/beta
Browse files Browse the repository at this point in the history
v4.2.2 - Bug fixes and minor enhancements
  • Loading branch information
edwardtfn authored Jan 16, 2024
2 parents 327de69 + dd3f345 commit 29087e2
Show file tree
Hide file tree
Showing 33 changed files with 454 additions and 995 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ body:
- type: textarea
attributes:
label: Home Assistant logs
description: You can get this from **Settings** > **System** > **Logs** in your Home Assistant.
description: You can get this from **Settings** > **System** > [**Logs**](https://my.home-assistant.io/redirect/logs/) in your Home Assistant.
render: logs
validations:
required: false
Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
blank_issues_enabled: true
contact_links:
- name: Troubleshooting TFT transfer
- name: Troubleshooting TFT Transfer
url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/tft_upload.md
about: Try this guide first if you are having issues to transfer a TFT file.
- name: Compiling Errors Guide
url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_compiling.md
about: Experiencing Compile Errors? Check This Guide!
- name: Getting Started with NSPanel HA Blueprint
url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/install.md
about: This is the starting poing for installing a new NSPanel HA Blueprint.
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/validate_yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
---
name: Validate YAML
name: Validate YAML (secondary files)

# yamllint disable-line rule:truthy
on:
push:
paths:
- '**/*.yml'
- '**/*.yaml'
pull_request:
paths:
- '**/*.yml'
- '**/*.yaml'
workflow_dispatch:

jobs:
Expand All @@ -27,6 +33,10 @@ jobs:
run: |
IFS=',' read -ra FILES <<< "${{ steps.changed-files.outputs.all_changed_files }}"
for file in "${FILES[@]}"; do
if [[ "$file" =~ ^nspanel_esphome.*\.yaml$ ]] || [[ "$file" =~ ^advanced/esphome/nspanel_esphome.*\.yaml$ ]] || [[ "$file" == "nspanel_blueprint.yaml" ]]; then
echo "Skipping $file"
continue
fi
echo "::group::Validating $file"
yamllint -c "./.rules/yamllint.yml" "$file"
echo "::endgroup::"
Expand Down
57 changes: 54 additions & 3 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,20 +308,63 @@ Below you'll find a detailed list of the changes.
While this update is designed to integrate smoothly with existing v4.2 components,
we recommend updating all components to this latest version for the best performance.

### Overview of Changes
**Overview of Changes:**
| Change | Criticality | Affected Components |
| :-- | :--: | :--: |
| Resolved issue with the dimming feature not activating when button is held (#1599) | Minor | `Blueprint` |
| Added "Clean Build Files" step to the update instructions for clarity (#1601) | Minor | `Documentation` |

### Key Improvements
**Key Improvements:**
- **Dimming Feature Fix**: Addressed an issue where the long press in the buttons was not responding as expected,
ensuring smoother light control from your panel.
- **Updated Documentation**: Enhanced our update instructions to include a "Clean Build Files" step,
providing clearer guidance for a more efficient update process.

## Patch v4.2.2
This update focuses on enhancing user customization, improving data management, and addressing a range of issues from minor to critical in our system.
Our commitment is to continuously enhance the usability, stability, and efficiency of your panel.

> [!IMPORTANT]
> **Breaking Change**: This patch requires Home Assistant v2023.12.0 or higher to ensure compatibility with new enhancements.
> Please update your Home Assistant installation before applying this patch.

We encourage all users to update their components to this latest version for the best experience.
While this update is compatible with existing v4.2 components, it offers optimized performance and usability when fully updated.

**Overview of Changes:**
| Change | Criticality | Affected Components |
| :-- | :--: | :--: |
| Fix Climate page not working with embedded climate (#1627) | Critical | `ESPHome` |
| Fix weather pages crashing when Home Assistant OS is not used (#1630) | Medium | `Blueprint` |
| Correct Wi-Fi reference in QR code example (#1609) | Minor | `Documentation` |
| Resolve incorrect labelling on entity pages (#1628) | Minor | `Blueprint` |
| Address lights with no brightness in 'supported_features' (#1633) | Minor | `Blueprint` |
| Implement ISO8601 date formatting option (#1610) | Enhancement | `Blueprint` |
| Enable dynamic icons based on device_class (#1635) | Enhancement | `Blueprint` |

**Key Improvements:**
- **Fix for Climate Page Not Working**: Resolved a critical issue with the climate page not functioning properly when using embedded climate controls (#1627).
This fix enhances system stability and user interaction with climate features.
- **Fix for Weather Pages Crashing**: Addressed an issue causing weather pages to crash when Home Assistant Operating System (HAOS) is not used (#1630).
This fix ensures stability and reliability of weather-related features across various Home Assistant installation modes, such as containerized installations and other setups.
- **Wi-Fi Reference Update in QR Code Example**: Updated the Wi-Fi reference in the QR code example (#1609) to prevent user errors during system setup.
This documentation change aids in clearer guidance for configuring connections.
- **Entity Pages Configuration Labeling**: Corrected the labeling of options in the blueprint for entity page configuration (#1628).
This fix ensures that the labels accurately reflect the behavior on the pages, enhancing the configuration experience.
- **Handling Lights Without Brightness Feature**: Improved handling of information for lights that lack brightness control in 'supported_features' (#1633).
This update resolves the issue of incorrectly displaying brightness levels (as "0%") for lights that do not support brightness adjustment, ensuring more accurate display of buttons.
- **ISO8601 Date Formatting**: Introduced ISO8601 date formatting (#1610) to improve date readability and consistency in the user interface.
- **Dynamic Icons Using Device Class**: Upgraded dynamic icons to utilize device_class (#1635), offering a more intuitive and context-aware UI.

For support, feedback, or detailed information about this update,
visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint)
or our [online documentation](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/README.md).

Special thanks to @PaulAntonDeen and @illuzn for their invaluable contributions to these enhancements.
Your feedback and support are crucial to our continuous improvement.

## What's Next?
Discover what's next and what we are working on right now in our [Milestones](https://github.com/Blackymas/NSPanel_HA_Blueprint/milestones?direction=asc&sort=title&state=open)
Discover what's next and what we are working on right now in our [Milestones](https://github.com/Blackymas/NSPanel_HA_Blueprint/milestones?direction=asc&sort=title&state=open).

## Special thanks to
- @bluefoxlee:
Expand All @@ -334,9 +377,17 @@ Discover what's next and what we are working on right now in our [Milestones](ht
- @andythomas:
- Allow to set upper and lower set points for embedded thermostat, #1573
- Bugfix for embedded climate/cool functionality, #1587
- @PaulAntonDeen:
- Add ISO8601 date formatting as an option, #1610 - Patch v4.2.2
- Fix Wi-Fi reference on QR code example, #1609 - Patch v4.2.2
- @illuzn:
- Fix for Lights with no brightness supported_features, #1633 - Patch v4.2.2
- Implement dynamic icons and use device_class, #1635 - Patch v4.2.2
- Fixes the incorrect labelling of the entity pages alignment, #1628 - Patch v4.2.2
- And to all users who helped with the tests during development and beta.

## Previous releases
- [v4.2.1 - Bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.1)
- [v4.2 - Multi-Alarm Control, Dual Thermostat Functionality, and More](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2)
- [v4.1.4 - Support to Home Assistant 2023.12.0](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.4)
- [v4.1.3 - Bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.1.3)
Expand Down
132 changes: 71 additions & 61 deletions advanced/esphome/nspanel_esphome_addon_climate_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ substitutions:

climate:
- platform: thermostat
name: ${device_name} Thermostat
name: ${name} Thermostat
id: thermostat_embedded
sensor: temp_nspanel
min_idle_time: ${min_idle_time}s
Expand Down Expand Up @@ -67,29 +67,46 @@ globals:
- id: addon_climate_friendly_name
type: std::string
restore_value: false
initial_value: '"${device_name} Thermostat"'
initial_value: '"${name} Thermostat"'

switch:
##### PHYSICAL SWITCH 0 (Dummy) - Used when relay is not set #####
- name: ${device_name} Relay 0 (dummy)
- name: ${name} Relay 0 (dummy)
platform: template
id: relay_0
lambda: !lambda return false;
internal: true
optimistic: true

script:
- id: !extend addon_climate_service_call
- id: !extend change_climate_state
then:
- lambda: |-
id(is_addon_climate_visible) = true;
disp1->set_component_value("climate.embedded", 1);
auto call = thermostat_embedded->make_call();
if (key == "set_temperature")
call.set_target_temperature(stof(value) / 10);
else if (key == "hvac_mode")
call.set_mode(value);
call.perform();
if (embedded) {
static const char *const TAG = "addon_climate_base.script.change_climate_state";
id(is_addon_climate_visible) = true;
disp1->set_component_value("climate.embedded", 1);
auto call = thermostat_embedded->make_call();
if (key == "temperature") {
ESP_LOGD(TAG, "set_target_temperature(%f)", (stof(value) / 10));
call.set_target_temperature(stof(value) / 10);
} else if (key == "target_temp_high") {
ESP_LOGD(TAG, "set_target_temperature_high(%f)", (stof(value) / 10));
call.set_target_temperature_high(stof(value) / 10);
} else if (key == "target_temp_low") {
ESP_LOGD(TAG, "set_target_temperature_low(%f)", (stof(value) / 10));
call.set_target_temperature_low(stof(value) / 10);
} else if (key == "hvac_mode") {
ESP_LOGD(TAG, "hvac_mode(%s)", value.c_str());
call.set_mode(value);
} else {
ESP_LOGE(TAG, "Invalid call:");
ESP_LOGE(TAG, " Embedded: %s", embedded ? "True" : "False");
ESP_LOGE(TAG, " Key: %s", key.c_str());
ESP_LOGE(TAG, " Value: %s", value.c_str());
}
call.perform();
}
- id: !extend global_settings
then:
Expand All @@ -105,59 +122,52 @@ script:
- id: !extend page_climate
then:
- lambda: |-
if (current_page->state == "climate" and id(is_addon_climate_visible))
{
disp1->set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str());
float temp_step = ${temp_step};
float temp_offset = ${temp_min};
float temp_max = ${temp_max};
float total_steps = (temp_max-temp_offset)/temp_step;
uint supported_hvac_modes = 0;
if (${addon_climate_dual})
supported_hvac_modes = 3;
else
supported_hvac_modes = supported_hvac_modes + ((${addon_climate_heat}) ? 1 : 0) + ((${addon_climate_cool}) ? 2 : 0);
set_climate->execute
(
thermostat_embedded->current_temperature, // current_temp
0, // supported_features
thermostat_embedded->target_temperature, // target_temp
thermostat_embedded->target_temperature_high, // target_temp_high
thermostat_embedded->target_temperature_low, // target_temp_low
int(round(${temp_step}*10)), // temp_step
int(round(total_steps)), // total_steps //int(round((10*thermostat_embedded->target_temperature-temp_offset)/temp_step)), // slider_val
int(round(${temp_min}*10)), // temp_offset
"", // climate_icon
true // embedded_climate
);
id(is_addon_climate_visible) = (current_page->state == "climate" and detailed_entity->state == "embedded_climate");
if (id(is_addon_climate_visible)) {
static const char *const TAG = "addon_climate_base.script.page_climate";
ESP_LOGV(TAG, "Climate page constructor:");
ESP_LOGV(TAG, " Add-on mode: %s", (${addon_climate_dual}) ? "Dual" : ((${addon_climate_heat}) ? "Heat" : ((${addon_climate_cool}) ? "Cool" : "Unknown")));
disp1->set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str());
float temp_step = ${temp_step};
float temp_offset = ${temp_min};
float temp_max = ${temp_max};
float total_steps = (temp_max-temp_offset)/temp_step;
set_climate->execute
(
thermostat_embedded->current_temperature, // current_temp
0, // supported_features
((${addon_climate_dual}) ? -999 : thermostat_embedded->target_temperature), // target_temp
((${addon_climate_dual}) ? thermostat_embedded->target_temperature_high : -999), // target_temp_high
((${addon_climate_dual}) ? thermostat_embedded->target_temperature_low : -999), // target_temp_low
int(round(${temp_step}*10)), // temp_step
int(round(total_steps)), // total_steps
int(round(${temp_min}*10)), // temp_offset
"", // climate_icon
true // embedded_climate
);
// Update target temp icon
update_climate_icon->execute("target_icon", int(thermostat_embedded->action), int(thermostat_embedded->mode));
// Update target temp icon
update_climate_icon->execute("target_icon", int(thermostat_embedded->action), int(thermostat_embedded->mode));
// Update buttons bar
// Hide not supported hotspots
disp1->hide_component("button01");
if (${addon_climate_dual}) disp1->show_component("button02"); else disp1->hide_component("button02");
if (${addon_climate_heat} or ${addon_climate_dual}) disp1->show_component("button03"); else disp1->hide_component("button03"); //Heat
if (${addon_climate_cool} or ${addon_climate_dual}) disp1->show_component("button04"); else disp1->hide_component("button04"); //Cool
disp1->hide_component("button05");
disp1->hide_component("button06");
disp1->show_component("button07"); //Off
// Set buttons colors
disp1->set_component_font_color("button01", 6339);
disp1->set_component_font_color("button02", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT_COOL) ? 65535 : ((${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button03", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT) ? 64164 : ((${addon_climate_heat} or ${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button04", (thermostat_embedded->mode==climate::CLIMATE_MODE_COOL) ? 1055 : ((${addon_climate_cool} or ${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button05", 6339);
disp1->set_component_font_color("button06", 6339);
disp1->set_component_font_color("button07", (thermostat_embedded->mode==climate::CLIMATE_MODE_OFF) ? 10597 : 35921);
// Update buttons bar
// Hide not supported hotspots
disp1->hide_component("button01");
if (${addon_climate_dual}) disp1->show_component("button02"); else disp1->hide_component("button02");
if (${addon_climate_heat} or ${addon_climate_dual}) disp1->show_component("button03"); else disp1->hide_component("button03"); //Heat
if (${addon_climate_cool} or ${addon_climate_dual}) disp1->show_component("button04"); else disp1->hide_component("button04"); //Cool
disp1->hide_component("button05");
disp1->hide_component("button06");
disp1->show_component("button07"); //Off
// Set buttons colors
disp1->set_component_font_color("button01", 6339);
disp1->set_component_font_color("button02", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT_COOL) ? 65535 : ((${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button03", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT) ? 64164 : ((${addon_climate_heat} or ${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button04", (thermostat_embedded->mode==climate::CLIMATE_MODE_COOL) ? 1055 : ((${addon_climate_cool} or ${addon_climate_dual}) ? 48631 : 6339));
disp1->set_component_font_color("button05", 6339);
disp1->set_component_font_color("button06", 6339);
disp1->set_component_font_color("button07", (thermostat_embedded->mode==climate::CLIMATE_MODE_OFF) ? 10597 : 35921);
}
- id: !extend page_changed
then:
- lambda: |-
id(is_addon_climate_visible) = (page == "climate" and detailed_entity->state == "embedded_climate");
- id: !extend page_home
then:
- lambda: |-
Expand Down
Loading

0 comments on commit 29087e2

Please sign in to comment.