Skip to content

Commit

Permalink
Merge pull request #2396 from Blackymas/v4.4.0.dev7
Browse files Browse the repository at this point in the history
Device's page clean-up
  • Loading branch information
edwardtfn authored Nov 23, 2024
2 parents acf71b8 + 6529cdc commit e3c4614
Show file tree
Hide file tree
Showing 36 changed files with 341 additions and 149 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/validate_esphome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,46 +399,46 @@ jobs:

- name: Update manifest.json - name
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: name
value: NSPanel HA Blueprint

- name: Update manifest.json - version
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: version
value: ${{ steps.extract_version.outputs.version }}

- name: Update manifest.json - builds.chipFamily
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: builds.chipFamily
value: ESP32

- name: Update manifest.json - builds.ota.path
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: builds.ota.path
value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/nspanel_esphome_prebuilt.bin"

- name: Update manifest.json - builds.ota.release_url
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: builds.ota.release_url
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}"

- name: Move and Rename Firmware File - nspanel_esphome_prebuilt
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
run: |
mkdir -p prebuilt
cp -R ${{ steps.build_nspanel_fw.outputs.name }}/. prebuilt/${{ steps.build_nspanel_fw.outputs.name }}/
Expand All @@ -455,46 +455,46 @@ jobs:

- name: Update manifest.json - name
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: name
value: Wall Display

- name: Update manifest.json - version
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: version
value: ${{ steps.extract_version.outputs.version }}

- name: Update manifest.json - builds.chipFamily
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: builds.chipFamily
value: ESP32

- name: Update manifest.json - builds.ota.path
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: builds.ota.path
value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/wall_display.bin"

- name: Update manifest.json - builds.ota.release_url
uses: jossef/action-set-json-field@v2.2
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: builds.ota.release_url
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}"

- name: Move and Rename Firmware File - wall_display
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
run: |
mkdir -p prebuilt
cp -R ${{ steps.build_wall_display_fw.outputs.name }}/. prebuilt/${{ steps.build_wall_display_fw.outputs.name }}/
Expand All @@ -503,15 +503,15 @@ jobs:
cp ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json prebuilt/wall_display.manifest.json || true
- name: Generate checksum for Firmware Files
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
run: |
md5sum prebuilt/nspanel_esphome_prebuilt.bin > prebuilt/nspanel_esphome_prebuilt.bin.md5
md5sum prebuilt/nspanel_esphome_prebuilt.factory.bin > prebuilt/nspanel_esphome_prebuilt.factory.bin.md5
md5sum prebuilt/wall_display.bin > prebuilt/wall_display.bin.md5
md5sum prebuilt/wall_display.factory.bin > prebuilt/wall_display.factory.bin.md5
- name: Commit and Push Firmware Files
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: (github.ref == 'refs/heads/dev' || github.base_ref == 'dev') && github.event_name != 'pull_request'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
Expand Down
208 changes: 103 additions & 105 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,127 +1,125 @@
# v4.4 - Automatic TFT Update
# v4.4 - Dynamic QR Codes, Improved Usability, and More

## General
This release introduces the option to automatically update the TFT when an older version is detected,
simplifying the update process and ensuring your panel always runs the latest display firmware.
Version 4.4 focuses on enhancing the usability and functionality of your NSPanel. The device page has been
refined for a cleaner, more user-friendly experience, now allowing you to control the panel as a light.

In addition to improved performance, this release introduces dynamic QR codes, automatic TFT updates, and
new features like buzzer volume control and configurable wake-up settings, making your panel more versatile.

## Breaking Changes and Guidance

### Home Assistant v2024.11.0 and ESPHome v2024.11.0 are required
Please refer to our [Version Compatibility Matrix](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md) for a full list.

### Changes on the versioning requires updating all the three components
Moving forward, update all three components (Blueprint, ESPHome, and TFT) together to ensure consistency.

### Many diagnostic sensors disappeared
I know some of you love some of those, but we had to compromise something to free-up a bit of memory for the new things.
The values are now shown in the logs and if you need as a sensor please report as an issue and we can support with customizations.
Refer to our
[Version Compatibility Matrix](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md).

### Users using the "Display as a light" customization must remove it
This is now part of the core system.
### Versioning changes require updating all three components
Update all components (Blueprint, ESPHome, and TFT) together for compatibility and consistency.

### Several changes in the API
Now all actions will use a common way of transferring information to ESPHome, with the main goal to make it easier to use,
but also trying to reduce the communication between ESPHome and Nextion, preventing buffer overflows and slowness on the interface.
We highly recommend visiting our [API documentation](docs/api.md) for the latest syntax for the different actions.
### Diagnostic sensors removed
Some diagnostic sensors were removed to free memory for new features. Their values are logged; request custom
sensor support via an issue if required.

In addition to this standardization, there are some noteworth changes to the API:
1. Deprecated actions:
### "Display as a light" customization removed
This feature is now part of the core system. Remove the related YAML customization from your configuration.

<!-- markdownlint-disable MD033 -->
| Deprecated action | Replacement | Previous use |
| :--: | :--: | :-- |
| `init_global`<br>`init_hardware`<br>`hw_button_state` | `set_number`<br>`set_string` | Used to send settings at boot |
| `init_page_home` | [`component`](docs/api.md#component-action-component) | Used to send global values to page Home |
| `set_timezone` | `set_string` | Used to send time zone settings at boot |
| `component_text`<br>`component_color`<br>`component_visibility`<br>`icon`| [`component`](docs/api.md#component-action-component) | Used to set a component on the display |
<!-- markdownlint-enable MD033 -->
### API changes and standardization
All actions now use a unified method to transfer information, reducing overhead and improving responsiveness
between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md) for details.

1. Sensor `blueprint_status` was removed
#### Key API Changes:
1. **Deprecated actions**
<!-- markdownlint-disable MD033 -->
| Deprecated action | Replacement | Previous use |
| :--------------------------------- | :----------------------- | :----------------------------- |
| `init_global`, `init_hardware` | `set_number`, `set_string` | Sent settings at boot |
| `init_page_home` | [`component`](docs/api.md#component-action-component) | Sent values to page Home |
| `set_timezone` | `set_string` | Sent timezone settings |
| `component_text`, `icon`, etc. | [`component`](docs/api.md#component-action-component) | Set display components |
<!-- markdownlint-enable MD033 -->

The boot process was totally rebuilt and this info is now transferred via events.
2. **Sensor `blueprint_status` removed**
Boot info is now transferred via events.

1. Notification unread sensor

The former "**Notification unread**" switch is now a binary sensor.
3. **Notification unread switch replaced**
The "**Notification unread**" switch is now a binary sensor.

### Customizations
We made improvements in some scripts, so the customizations using those scripts must be updated:
- [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons)
Updated scripts require adjustments to these customizations:
- [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons)
- [Set display as a light (deprecated)](docs/customization.md#set-display-as-a-light)

## Noteworthy Changes

### Dynamic QR Code
- **Description:**
Introduces the ability to assign an entity (supports input text or sensors) to a QR code.
The QR code will automatically update on the panel when the entity's value changes.

In addition, the limit for a QRcode was extended to 96 chars (or bytes), giving more room for complex codes.

This feature is useful in cases where you have dynamic content, such as a Wi-Fi password, and
want the panel to display the updated value in real-time.

Your current selection for QRcode still working, as it will be used as a fallback value when an entity is not used or is used, but it is unavailable.
- **Related Issue Numbers:**
- #452
- #2282
- #2283

### Full support to 921600bps
- **Description:**
The default baud rate for the communication between ESP32 (ESPHome) and the Nextion Display was changed from 115200bps to 921600bps, multiplying by 8 the transfer rate.
This may increase the responsiveness and user experience, and will allow for future development of features which requires more of this communication.
- **Related Issue Numbers:**
- #2230
- **Issues and discussions that could benefit from this in the future:**
- #1270
- #2328
- #2357
Assign an entity (input text or sensor) to a QR code. The QR code updates dynamically with entity value changes.
QR code length limit extended to 96 chars for more complex codes.

If no entity is set or is unavailable, the fallback QR code is used.

**Related Issues:**
- #452
- #2282
- #2283

### Full support for 921600bps
Communication baud rate between ESP32 and Nextion increased from 115200bps to 921600bps, enhancing transfer speed.
This supports better user experience and future feature development.

**Related Issues:**
- #2230
- #1270
- #2328
- #2357

### Buzzer volume control
- **Description:**
Now you can set the volume level of your panel's buzzer, allowing to better experience when using your panel for sounds.

> [!NOTE]
> You can disable the sound on changing volume by adding the following to your panel's substitutions:
> ```yaml
> substitutions:
> tone_volume_change: "none" # Or choose your own RTTTL tone
### Screen Wake-Up on Hardware Button Press Configurable
- **Description:** Added a new switch to configure whether the panel should wake up when a hardware button is pressed.
This switch is available under **Settings** > **Devices & services** > **ESPHome** in Home Assistant.
It provides users with flexibility to control display wake-up behavior via hardware buttons.
- **Issue Number:** #2194
### TFT Update Automatically
- **Description:** Introduced an automatic TFT update mechanism that triggers whenever the system detects an outdated TFT version.
This enhancement streamlines the process of keeping your NSPanel display firmware up to date, minimizing manual intervention.
- **Issue Number:** #2227
### Versioning Engine Updated to Enforce Patch-Level Consistency
- **Description:** Updated the versioning engine to require all components (Blueprint, ESPHome, and TFT) to match at the patch level,
enhancing reliability by ensuring all parts are fully synchronized. This supports the new automatic TFT update feature.
### Panel Display Control via Light Entity
- **Description:** Introduced a light entity to represent the NSPanel's display, allowing users to control the panel’s brightness, wake it up,
or put it to sleep through third-party automations designed for lights.
Users with existing customizations should remove them from their YAML configuration.
- **Issue Number:** #2091
### Updated CLIMATE_MODE_AUTO Icon on Climate Page
- **Description:** Updated the CLIMATE_MODE_AUTO icon on the Climate page from “mdi:calendar-sync” to “mdi:refresh-auto.”
This change provides a clearer representation of the automatic mode.
- **Issue Number:** #2243
### Updated References from `service` to `action` for Compatibility with New Standards
- **Description:** Updated all references from `service` to `action` to comply with Home Assistant v2024.8.0 and ESPHome v2024.8.0 standards,
ensuring full compatibility with the latest versions.
### Reduced Logging to Enhance Focus on Critical Information
- **Description:** Logging has been streamlined to focus on the most critical information, reducing noise and improving the clarity of logs.
While this change enhances readability and allows users to quickly identify important messages,
it may alter the behavior of existing troubleshooting processes that relied on more verbose logs.
> [!WARNING]
> Users who depend on detailed logs for debugging may need to adjust their troubleshooting strategies or temporarily adjust log levels as needed.
Set the panel buzzer volume for a tailored sound experience.

> [!NOTE]
> Disable sound during volume change by adding the following to substitutions:
> ```yaml
> substitutions:
> tone_volume_change: "none" # Or set a custom RTTTL tone
> ```
### Configurable hardware button wake-up
A new switch configures whether hardware button presses wake the panel.
Access this option via **Settings** > **Devices & services** > **ESPHome** in Home Assistant.
**Related Issues:**
- #2194
### Automatic TFT updates
Automatic TFT updates now trigger when an outdated version is detected, minimizing manual intervention.
**Related Issues:**
- #2227
### Versioning engine updated
All components (Blueprint, ESPHome, and TFT) now enforce patch-level version consistency, ensuring reliability.
### Panel display control via light entity
Added a light entity for controlling the display’s brightness, waking it up, or putting it to sleep.
Remove any existing custom YAML configuration for display control.
**Related Issues:**
- #2091
### Updated CLIMATE_MODE_AUTO icon
The Climate page's CLIMATE_MODE_AUTO icon changed from `mdi:calendar-sync` to `mdi:refresh-auto` for clarity.
**Related Issues:**
- #2243
### References updated from `service` to `action`
Revised API to replace `service` with `action`, ensuring compatibility with Home Assistant and ESPHome standards.
### Streamlined logging
Logging reduced to critical info, improving readability. This change may impact troubleshooting processes.
> [!WARNING]
> Adjust log levels if more detailed information is needed for debugging.
### Device page clean-up
The device page was refined for better usability and clarity. The panel now integrates more seamlessly
into automation workflows.
10 changes: 5 additions & 5 deletions esphome/nspanel_esphome_addon_upload_tft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ substitutions:
nextion_update_url: "${nextion_update_base_url}/main/hmi/nspanel_blank.tft"
##############################################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT

# yamllint disable rule:comments-indentation
api:
actions:
Expand Down Expand Up @@ -80,6 +75,11 @@ display:
tft_url: ${nextion_update_url}
exit_reparse_on_start: true

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT

globals:
- id: tft_upload_attempt
type: uint8_t
Expand Down
5 changes: 5 additions & 0 deletions esphome/nspanel_esphome_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ api:
id: api_server
reboot_timeout: 60min

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_CORE

packages:
# yamllint disable rule:colons
base: !include nspanel_esphome_core_base.yaml
Expand Down
2 changes: 1 addition & 1 deletion esphome/nspanel_esphome_core_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ esphome:
platformio_options:
build_flags:
- -Wno-missing-field-initializers
- -D NSPANEL_HA_BLUEPRINT_CORE
- -D NSPANEL_HA_BLUEPRINT_CORE_BASE

external_components:
- source:
Expand Down
Loading

0 comments on commit e3c4614

Please sign in to comment.