From 4b9051542579660c08ca18699d8c63636594043b Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 26 Feb 2024 19:05:34 +0100 Subject: [PATCH] Lint --- ReleaseNotes.md | 27 ++++++++++++----- docs/api.md | 18 +++++++---- .../nspanel_esphome_addon_climate_base.yaml | 2 +- esphome/nspanel_esphome_core.yaml | 30 ++++++++++++++----- nspanel_blueprint.yaml | 9 +++++- 5 files changed, 63 insertions(+), 23 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 0309196..2a3ffac 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -3,26 +3,37 @@ ## General *To be updated.* -Hello everyone! We're excited to introduce enhancements in this update, focusing on improving user interaction and expanding customization options. This release features an intuitive TFT upload process, enhanced Alarm Control Panels & Thermostats functionality, and new personalization options. +Hello everyone! +We're excited to introduce enhancements in this update, focusing on improving user interaction and expanding customization options. +This release features an intuitive TFT upload process, enhanced Alarm Control Panels & Thermostats functionality, and new personalization options. -We're committed to making NSPanel firmware more user-friendly. This release marks significant progress, including a streamlined TFT upload process and steps towards adopting `esp-idf` as the default framework. Our documentation has been revamped for clarity and ease of use. Stay tuned for more updates! +We're committed to making NSPanel firmware more user-friendly. +This release marks significant progress, including a streamlined TFT upload process and steps towards adopting `esp-idf` as the default framework. +Our documentation has been revamped for clarity and ease of use. +Stay tuned for more updates! [Learn more about our efforts](https://github.com/Blackymas/NSPanel_HA_Blueprint/discussions/1602). ## ESP-IDF Framework Transition -With this release, we've officially transitioned to the **ESP-IDF** framework. This move is part of our ongoing efforts to enhance the memory capacity and expand the features available on the ESP, facilitating broader customization and new functionalities. +With this release, we've officially transitioned to the **ESP-IDF** framework. +This move is part of our ongoing efforts to enhance the memory capacity and expand the features available on the ESP, facilitating broader customization and new functionalities. For users updating to this version: - **Flashing Required**: To adopt the ESP-IDF framework, flashing your device using a serial cable is necessary. This step mirrors the initial custom firmware setup process. -- **Arduino Framework Still Available**: For those who prefer the `arduino` framework or require Over-The-Air (OTA) updates, it remains an option. Detailed guidance on how to choose your framework is provided in our [customization documentation](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/customization.md). +- **Arduino Framework Still Available**: For those who prefer the `arduino` framework or require Over-The-Air (OTA) updates, it remains an option. +Detailed guidance on how to choose your framework is provided in our [customization documentation](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/customization.md). -This transition is a significant milestone for us, promising a robust platform for our community. We're here to help with any questions or assistance needed during this change. For more details and support, visit our [community discussion](https://github.com/Blackymas/NSPanel_HA_Blueprint/discussions/1756). +This transition is a significant milestone for us, promising a robust platform for our community. +We're here to help with any questions or assistance needed during this change. +For more details and support, visit our [community discussion](https://github.com/Blackymas/NSPanel_HA_Blueprint/discussions/1756). ## Updating -Please review your settings post-update to ensure compatibility. Refer to the update procedures [here](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/howto.md#update-blueprint). +Please review your settings post-update to ensure compatibility. +Refer to the update procedures [here](https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/howto.md#update-blueprint). ## Breaking Changes and Guidance -With this release, we're implementing several important changes. While we strive to improve the panel, we understand that changes can affect your setups. +With this release, we're implementing several important changes. +While we strive to improve the panel, we understand that changes can affect your setups. Here's a detailed overview and guidance for a smooth transition: 1. **Transition to ESP-IDF Framework**: This release marks the official switch to the ESP-IDF framework, enhancing performance and allowing for more complex features. @@ -89,6 +100,8 @@ Discover our upcoming projects in our [Milestones](https://github.com/Blackymas/ *Details to be added.* ## Previous releases +- [v4.2.6 - Enhancing Stability and User Experience](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.6) +- [v4.2.5 - Celebrating 1000 Stars with Enhanced Functionality and UI Improvements](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.5) - [v4.2.4 - Critical bug fixes](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.4) - [v4.2.3 - Bug fixes and minor enhancements](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.3) - [v4.2.2 - Bug fixes and minor enhancements](https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v4.2.2) diff --git a/docs/api.md b/docs/api.md index 452d707..2703b0b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -257,7 +257,8 @@ data: Updates the on-screen indication bars for the hardware buttons, reflecting the current state of the entities they control. **Usage:** -This service updates the visual state (on/off) of the left and right hardware button indicators on the panel. It's used to provide visual feedback corresponding to the state of the entities controlled by these hardware buttons. +This service updates the visual state (on/off) of the left and right hardware button indicators on the panel. +It's used to provide visual feedback corresponding to the state of the entities controlled by these hardware buttons. **Parameters:** - `left` (bool): The state to set for the left button's indication bar. @@ -343,11 +344,13 @@ It tailors ESPHome's hardware operations for specific use cases, including local **Parameters:** - `relay1_local_control` (bool): Enables or disables local control for Relay 1. -- `relay1_icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for Relay 1. +- `relay1_icon` (string): +Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for Relay 1. - `relay1_icon_color` (int[]): The RGB color array for Relay 1's icon. - `relay1_fallback` (bool): Determines the fallback state for Relay 1 in case of communication loss. - `relay2_local_control` (bool): Enables or disables local control for Relay 2. -- `relay2_icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for Relay 2. +- `relay2_icon` (string): +Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for Relay 2. - `relay2_icon_color` (int[]): The RGB color array for Relay 2's icon. - `relay2_fallback` (bool): Determines the fallback state for Relay 2 in case of communication loss. - `button_left` (bool): Enable/disable left button status visualization. @@ -398,16 +401,19 @@ It accommodates extensive customizations, impacting both visual appeal and funct - `meridiem` (string[]): Array of strings for AM/PM labels, applicable if the time format includes meridiem. - `chip_font` (int): Font Id for icons or chips displayed on the "Home" page. - `custom_buttons_font` (int): Font Id for custom button icons on the "Home" page. -- `notification_icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) +- `notification_icon` (string): +Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for the notification button. - `notification_icon_color_normal` (int[]): RGB color array for the notification icon under normal conditions. - `notification_icon_color_unread` (int[]): RGB color array for the notification icon when there are unread notifications. - `qrcode` (bool): Flag indicating whether the QR code button is enabled. -- `qrcode_icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) +- `qrcode_icon` (string): +Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for the QR code button. - `qrcode_icon_color` (int[]): RGB color array for the QR code button icon. - `entities_pages` (bool): Flag indicating whether the entities page button is enabled. -- `entities_pages_icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) +- `entities_pages_icon` (string): +Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html) for the entities page button. - `entities_pages_icon_color` (int[]): RGB color array for the entities page button icon. - `outdoor_temp_font` (int): Font Id for outdoor temperature indication on the "Home" page. diff --git a/esphome/nspanel_esphome_addon_climate_base.yaml b/esphome/nspanel_esphome_addon_climate_base.yaml index cd6279d..55afe7f 100644 --- a/esphome/nspanel_esphome_addon_climate_base.yaml +++ b/esphome/nspanel_esphome_addon_climate_base.yaml @@ -121,7 +121,7 @@ script: call.perform(); } - - id: !extend global_settings + - id: !extend init_hardware_climate then: - lambda: |- id(addon_climate_friendly_name) = embedded_climate_friendly_name; diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 0986cc2..72f24b6 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -340,6 +340,12 @@ api: embedded_climate_friendly_name: string # Friendly name for the climate control feature. embedded_indoor_temperature: bool # Enables indoor temperature display. then: + - script.execute: + id: init_hardware_climate + embedded_climate: !lambda return embedded_climate; + embedded_climate_friendly_name: !lambda return embedded_climate_friendly_name; + embedded_indoor_temperature: !lambda return embedded_indoor_temperature; + - lambda: |- if (not id(is_uploading_tft)) { using namespace nspanel_ha_blueprint; @@ -387,16 +393,8 @@ api: // Refresh buttons bars display refresh_hardware_buttons_bars->execute(); - - // Embedded thermostat - id(is_embedded_thermostat) = embedded_climate; - - // Indoor temperature - id(embedded_indoor_temp) = embedded_indoor_temperature; - display_embedded_temp->execute(); } blueprint_status->publish_state(int(blueprint_status->raw_state) | (1 << 4)); - # Sets up the "Home" page in ESPHome with customized settings and UI elements as defined in the project blueprint. - service: init_page_home variables: @@ -1977,6 +1975,21 @@ script: } } + - id: init_hardware_climate + mode: restart + parameters: + embedded_climate: bool # Indicates if climate control is integrated. + embedded_climate_friendly_name: string # Friendly name for the climate control feature. + embedded_indoor_temperature: bool # Enables indoor temperature display. + then: + - lambda: |- + // Embedded thermostat + id(is_embedded_thermostat) = embedded_climate; + + // Indoor temperature + id(embedded_indoor_temp) = embedded_indoor_temperature; + display_embedded_temp->execute(); + - id: notification_clear mode: restart then: @@ -2682,6 +2695,7 @@ script: global_settings->stop(); ha_button->stop(); ha_call_service->stop(); + init_hardware_climate->stop(); notification_clear->stop(); page_alarm->stop(); page_blank->stop(); diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index f8184d7..a4fba0d 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -9564,7 +9564,14 @@ action: - ESPHome: {{ nspanel_event.esphome }} - - Blueprint (reported by ESPHome):{{ nspanel_event.blueprint if nspanel_event.blueprint is defined and nspanel_event.blueprint is string and nspanel_event.blueprint | length > 0 else "Unknown" }} + - Blueprint (reported by ESPHome): {{ + nspanel_event.blueprint + if + nspanel_event.blueprint is defined and + nspanel_event.blueprint is string and + nspanel_event.blueprint | length > 0 + else "Unknown" + }} - Blueprint (expected): {{ blueprint_version }} continue_on_error: true