From d7d708a9e18ac556e733a8639bac999b51cf6e85 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:55:56 +0200 Subject: [PATCH] Standardize `component` on API --- ReleaseNotes.md | 22 +- docs/api.md | 34 ++-- esphome/nspanel_esphome_addon_upload_tft.yaml | 8 +- esphome/nspanel_esphome_core_base.yaml | 4 +- esphome/nspanel_esphome_core_boot.yaml | 6 +- esphome/nspanel_esphome_core_datetime.yaml | 4 +- esphome/nspanel_esphome_core_hw_buttons.yaml | 4 +- esphome/nspanel_esphome_core_hw_display.yaml | 66 +++--- esphome/nspanel_esphome_core_hw_relays.yaml | 12 +- esphome/nspanel_esphome_core_hw_wifi.yaml | 4 +- esphome/nspanel_esphome_core_page_blank.yaml | 6 +- esphome/nspanel_esphome_core_page_boot.yaml | 4 +- .../nspanel_esphome_core_page_buttons.yaml | 34 ++-- .../nspanel_esphome_core_page_entities.yaml | 4 +- esphome/nspanel_esphome_core_page_home.yaml | 8 +- ...spanel_esphome_core_page_notification.yaml | 6 +- esphome/nspanel_esphome_core_page_qrcode.yaml | 6 +- ...nspanel_esphome_core_page_screensaver.yaml | 2 +- esphome/nspanel_esphome_core_versioning.yaml | 2 +- nspanel_blueprint.yaml | 192 +++++++++--------- 20 files changed, 219 insertions(+), 209 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index c81457c4c..0d9fa57e1 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,7 +1,8 @@ # v4.4 - Automatic TFT Update ## 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. +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. ## Breaking Changes and Guidance @@ -14,13 +15,20 @@ Moving forward, update all three components (Blueprint, ESPHome, and TFT) togeth ### Users using the "Display as a light" customization must remove it This is now part of the core system. -### Action `components_visibility` is deprecated +### 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. + +In addition to this standardization, there are some noteworth changes to the API: + +#### Action `components_visibility` is deprecated It was replaced by [`component_visibility` action](docs/api.md#component-visibility-action-component_visibility). -### Action `icon` now requires page name as a parameter +#### Action `icon` now requires page name as a parameter More info at [API doc - Icon action](docs/api.md#icon-action-icon). -### Actions `init_global`, `init_hardware`, `init_page_home` and `hw_button_state` are deprecated +#### Actions `init_global`, `init_hardware`, `init_page_home` and `hw_button_state` are deprecated It was replaced by a few `set_` var actions during the boot or automation reloaded. ### Sensor `blueprint_status` was removed @@ -96,13 +104,15 @@ The boot process was totally rebuilt. ### Updated References from `service` to `action` for Compatibility with New Standards - **Criticality:** Enhancement - **Affected Components:** Blueprint, ESPHome -- **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. +- **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 - **Criticality:** Enhancement, Breaking Change - **Affected Components:** ESPHome, Blueprint - **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. + 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. diff --git a/docs/api.md b/docs/api.md index 80b832b1d..fc512505e 100644 --- a/docs/api.md +++ b/docs/api.md @@ -76,7 +76,7 @@ It's particularly useful for reflecting changes in device states or user interac **Parameters:** - `page` (string): The page identifier where the button is located. -- `component_id` (string): The button's unique identifier. +- `component` (string): The button's unique identifier. - `state` (bool): The state of the button, which can affect its background picture and other visual elements. - `icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html). Example: "\uE6E8" for `mdi:lightbulb-on-outline`. @@ -90,7 +90,7 @@ Example: "\uE6E8" for `mdi:lightbulb-on-outline`. action: esphome._button data: page: "buttonpage01" - component_id: "button08" + component: "button08" state: true icon: "\uE6E8" # Example for mdi:lightbulb-on-outline icon_color: [255, 0, 0] # Red @@ -131,20 +131,20 @@ This action is ideal for creating visually dynamic interfaces, allowing elements events, or user actions, such as indicating status changes or highlighting specific UI components. **Parameters:** -- `component_id` (string): Identifier of the component whose color will be updated. It is essential that this matches the component's ID in your display layout to ensure the correct element is targeted. +- `component` (string): Identifier of the component whose color will be updated. It is essential that this matches the component's ID in your display layout to ensure the correct element is targeted. - `color` (int[]): The new color for the component, specified as an RGB array (e.g., `[255, 0, 0]` for red). **Home Assistant Example:** ```yaml action: esphome._component_color data: - component_id: "home.time" + component: "home.time" color: [255, 0, 0] # Changes the component's color to red ``` > [!NOTE] > Replace `` with your specific panel name as configured in Home Assistant to ensure correct action execution. > -> Ensure the `component_id` and color parameters accurately target and define the new color for the component. +> Ensure the `component` and color parameters accurately target and define the new color for the component. ### Component Text Action: `component_text` Updates the text of a specified component on the display, enabling dynamic text content updates. @@ -153,20 +153,20 @@ Updates the text of a specified component on the display, enabling dynamic text Ideal for user interfaces that require real-time text updates, such as status messages, labels, or any text-based information display. **Parameters:** -- `component_id` (string): Identifier of the component whose text will be updated. Ensure this matches the component's ID in your display layout. +- `component` (string): Identifier of the component whose text will be updated. Ensure this matches the component's ID in your display layout. - `txt` (string): The new text content to display. This can include static text or dynamic information passed at runtime. **Home Assistant Example:** ```yaml action: esphome._component_text data: - component_id: "home.time" + component: "home.time" txt: "12:34" ``` > [!NOTE] > Replace `` with your specific panel name as configured in Home Assistant to ensure correct action execution. > -> Make sure the `component_id` corresponds to the correct component on your display for the text update to work as intended. +> Make sure the `component` corresponds to the correct component on your display for the text update to work as intended. ### Component Value Action: `component_val` Updates the value of a specified component on the display, enabling dynamic value updates. @@ -175,20 +175,20 @@ Updates the value of a specified component on the display, enabling dynamic valu Ideal for interfaces requiring real-time updates of numerical values, such as counters, temperature readings, or any numeric indicators. **Parameters:** -- `component_id` (string): Identifier of the component whose value will be updated. It's crucial this matches the component's ID in your display layout accurately. +- `component` (string): Identifier of the component whose value will be updated. It's crucial this matches the component's ID in your display layout accurately. - `val` (int): The new integer value to be set for the component. This can represent various data types, depending on the component's purpose (e.g., temperature, humidity levels). **Home Assistant Example:** ```yaml action: esphome._component_val data: - component_id: "cover.coverslider" + component: "cover.coverslider" val: 25 ``` > [!NOTE] > Replace `` with your specific panel name as configured in Home Assistant to ensure correct action execution. > -> Ensure the `component_id` accurately matches the component on your display to successfully update its value. +> Ensure the `component` accurately matches the component on your display to successfully update its value. ### Component Visibility Action: `component_visibility` Hides or shows a component on the display, allowing for dynamic interface changes. @@ -198,7 +198,7 @@ This action is ideal for creating interactive user interfaces that adapt by hidi **Parameters:** - `page` (string): Identifies the page where the component belongs to. -- `component_id` (string): Identifiers of the components to be hidden/shown. It is crucial that this matches the component's ID in your display layout to ensure the correct element is hidden/shown. +- `component` (string): Identifiers of the components to be hidden/shown. It is crucial that this matches the component's ID in your display layout to ensure the correct element is hidden/shown. - `show` (bool): Set to true to show the component, or false to hide it. **Home Assistant Example:** @@ -206,7 +206,7 @@ This action is ideal for creating interactive user interfaces that adapt by hidi action: esphome._component_hide data: page: home - component_id: "date" # Hides the date display on Home page + component: "date" # Hides the date display on Home page show: false ``` @@ -256,7 +256,7 @@ This action is ideal for dynamically updating icons on your Panel, allowing for **Parameters:** - `page` (string): Identifies the page where the component belongs to. -- `component_id` (string): Identifier of the chip or button component. Refer to "[Screen components](#screen-components)" for more details. +- `component` (string): Identifier of the chip or button component. Refer to "[Screen components](#screen-components)" for more details. - `icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html). Example: "\uE6E8" for `mdi:lightbulb-on-outline`. - `icon_color` (int[]): RGB color array for the icon. Example: `[0, 255, 0]` for green. @@ -267,7 +267,7 @@ Example: "\uE6E8" for `mdi:lightbulb-on-outline`. action: esphome._icon data: page: home - component_id: "chip03" + component: "chip03" icon: "\uE6E8" # Example for mdi:lightbulb-on-outline icon_color: [0, 255, 0] # Green visible: true @@ -593,7 +593,7 @@ Updates an entity to display specific values, allowing for dynamic updates of ic This action is intended for entities that need to display information dynamically, such as sensor readings or state values, with customized icons, names, and color coding for both icon and value. **Parameters:** -- `component_id` (string): Identifier of the entity being updated. For details on entity identifiers, refer to "[Screen components](#screen-components)". +- `component` (string): Identifier of the entity being updated. For details on entity identifiers, refer to "[Screen components](#screen-components)". - `icon` (string): Icon codepoint from [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html). Indicates the icon displayed next to the value. - `icon_color` (int[]): RGB color array for the icon, allowing for custom icon colors. @@ -605,7 +605,7 @@ Indicates the icon displayed next to the value. ```yaml action: esphome._value data: - component_id: "sensor.temperature" + component: "sensor.temperature" icon: "\uE6E8" # Example for mdi:thermometer icon_color: [255, 0, 0] # Red name: "Temperature" diff --git a/esphome/nspanel_esphome_addon_upload_tft.yaml b/esphome/nspanel_esphome_addon_upload_tft.yaml index 931a75461..5001b7136 100644 --- a/esphome/nspanel_esphome_addon_upload_tft.yaml +++ b/esphome/nspanel_esphome_addon_upload_tft.yaml @@ -194,21 +194,21 @@ script: - script.execute: id: set_component_visibility page: confirm - component_id: bclose + component: bclose show: false - script.execute: id: set_component_visibility page: confirm - component_id: bt_accept + component: bt_accept show: false - script.execute: id: set_component_visibility page: confirm - component_id: bt_clear + component: bt_clear show: false - script.execute: id: set_component_text - component_id: confirm.title + component: confirm.title text: Upload TFT - id: report_upload_progress diff --git a/esphome/nspanel_esphome_core_base.yaml b/esphome/nspanel_esphome_core_base.yaml index c5cf78515..6496fc76c 100644 --- a/esphome/nspanel_esphome_core_base.yaml +++ b/esphome/nspanel_esphome_core_base.yaml @@ -135,7 +135,7 @@ ota: then: - script.execute: id: set_component_value - component_id: progress + component: progress val: 0 - script.execute: id: boot_log @@ -157,7 +157,7 @@ ota: then: - script.execute: id: set_component_value - component_id: progress + component: progress val: 100 - script.execute: id: boot_log diff --git a/esphome/nspanel_esphome_core_boot.yaml b/esphome/nspanel_esphome_core_boot.yaml index 3bca0ef51..1c6a4fbe7 100644 --- a/esphome/nspanel_esphome_core_boot.yaml +++ b/esphome/nspanel_esphome_core_boot.yaml @@ -126,7 +126,7 @@ script: then: - script.execute: id: set_component_value - component_id: progress + component: progress val: !lambda return get_boot_progress_percentage(); - id: boot_progress_dump @@ -220,7 +220,7 @@ script: val: !lambda return int(display_dim_brightness->state); - script.execute: id: set_component_value - component_id: settings.dimslider + component: settings.dimslider val: !lambda return int(display_dim_brightness->state); - script.execute: id: set_variable_value @@ -232,7 +232,7 @@ script: val: !lambda return int(display_brightness->state); - script.execute: id: set_component_value - component_id: settings.brightslider + component: settings.brightslider val: !lambda return int(display_brightness->state); - script.execute: id: set_brightness diff --git a/esphome/nspanel_esphome_core_datetime.yaml b/esphome/nspanel_esphome_core_datetime.yaml index 28bdff25a..bb1d41d6a 100644 --- a/esphome/nspanel_esphome_core_datetime.yaml +++ b/esphome/nspanel_esphome_core_datetime.yaml @@ -106,8 +106,8 @@ script: - id: !extend set_component_font_color # Defined by nspanel_esphome_core_hw_display.yaml then: - lambda: |- - if (component_id == "home.date") id(home_date_color) = color; - else if (component_id == "home.time") id(home_time_color) = color; + if (component == "home.date") id(home_date_color) = color; + else if (component == "home.time") id(home_time_color) = color; - id: set_timezone mode: restart diff --git a/esphome/nspanel_esphome_core_hw_buttons.yaml b/esphome/nspanel_esphome_core_hw_buttons.yaml index 9cf236aad..61042f23f 100644 --- a/esphome/nspanel_esphome_core_hw_buttons.yaml +++ b/esphome/nspanel_esphome_core_hw_buttons.yaml @@ -209,8 +209,8 @@ script: - id: !extend set_component_font_color # Defined by nspanel_esphome_core_hw_display.yaml then: - lambda: |- - if (component_id == "button_bar_color_on") id(buttons_color_on) = color; - else if (component_id == "button_bar_color_off") id(buttons_color_off) = color; + if (component == "button_bar_color_on") id(buttons_color_on) = color; + else if (component == "button_bar_color_off") id(buttons_color_off) = color; - id: !extend set_var_int # Defined by nspanel_esphome_core_base.yaml then: diff --git a/esphome/nspanel_esphome_core_hw_display.yaml b/esphome/nspanel_esphome_core_hw_display.yaml index 3eefa3840..3ba071c0f 100644 --- a/esphome/nspanel_esphome_core_hw_display.yaml +++ b/esphome/nspanel_esphome_core_hw_display.yaml @@ -27,7 +27,7 @@ api: # Changes the foreground color of a specified component on the display. - action: component_color variables: - component_id: string # Identifier of the component to change color. Ensure this matches the component's ID in your display layout. + component: string # Identifier of the component to change color. Ensure this matches the component's ID in your display layout. color: int[] # New color for the component, specified as an RGB array (e.g., [255, 0, 0] for red). then: - if: @@ -36,42 +36,42 @@ api: then: - script.execute: id: set_component_font_color - component_id: !lambda return component_id; + component: !lambda return component; color: !lambda return (((color[0] & 0xF8) << 8) | ((color[1] & 0xFC) << 3) | (color[2] >> 3)); # Updates the text of a specified component on the display. - action: component_text variables: - component_id: string # Identifier of the component. Ensure it matches the component's ID in your display layout. + component: string # Identifier of the component. Ensure it matches the component's ID in your display layout. txt: string # New text content to be displayed. Supports both static and dynamic content. then: - script.execute: id: set_component_text - component_id: !lambda return component_id; + component: !lambda return component; text: !lambda return txt; # Updates the value of a specified component on the display. - action: component_val variables: - component_id: string # Identifier of the component to update. Must match the component's ID in the display layout. + component: string # Identifier of the component to update. Must match the component's ID in the display layout. val: int # New integer value to set for the component. Adjust based on the data type you're displaying. then: - script.execute: id: set_component_value - component_id: !lambda return component_id; + component: !lambda return component; val: !lambda return val; # Hides or shows a specified component on the display. - action: component_visibility variables: page: string # Page where the component is located - component_id: string # Identifier of the component to be hidden/shown. Ensure this matches the component's ID in your display layout. + component: string # Identifier of the component to be hidden/shown. Ensure this matches the component's ID in your display layout. show: bool # Set to true to show the component, or false to hide it. then: - script.execute: id: set_component_visibility page: !lambda return page; - component_id: !lambda return component_id; + component: !lambda return component; show: !lambda return show; # Displays detailed information for a specific entity. @@ -118,25 +118,25 @@ api: then: - script.execute: id: set_component_value - component_id: climate.embedded + component: climate.embedded val: !lambda if (entity == "embedded_climate") return 1; else return 0; # Icon action - action: icon variables: page: string # Page name - component_id: string # Identifier of the component. See "Screen components" in the documentation. + component: string # Identifier of the component. See "Screen components" in the documentation. icon: string # Icon codepoint, e.g., "/uE6E8" for `mdi:lightbulb-on-outline`. icon_color: int[] # RGB color array for the icon, e.g., [0, 255, 0] for green. visible: bool # Set to `true` for visible or `false` for hidden. then: - if: condition: - - lambda: return not component_id.empty(); + - lambda: return not component.empty(); then: - script.execute: id: set_component_text - component_id: !lambda return component_id; + component: !lambda return component; text: !lambda |- return visible ? icon.c_str() : ""; - if: @@ -145,18 +145,18 @@ api: then: - script.execute: id: set_component_font_color - component_id: !lambda return component_id; + component: !lambda return component; color: !lambda return (((icon_color[0] & 0xF8) << 8) | ((icon_color[1] & 0xFC) << 3) | (icon_color[2] >> 3)); - script.execute: id: set_component_visibility page: !lambda return page; - component_id: !lambda return component_id; + component: !lambda return component; show: !lambda return visible; # Updates an entity to display specific values with dynamic icons, names, and color codes. - action: value variables: - component_id: string # Identifier of the entity. See "Screen components" for entity IDs. + component: string # Identifier of the entity. See "Screen components" for entity IDs. icon: string # Icon codepoint (e.g., "/uE6E8" for mdi:thermometer) from HASwitchPlate Material Design Icons. icon_color: int[] # RGB color array for the icon (e.g., [255, 0, 0] for red). name: string # Display name for the entity (e.g., "Temperature"). @@ -165,7 +165,7 @@ api: then: - if: condition: - - lambda: return not component_id.empty(); + - lambda: return not component.empty(); then: - if: condition: @@ -173,7 +173,7 @@ api: then: - script.execute: id: set_component_text - component_id: !lambda return (component_id + "_icon").c_str(); + component: !lambda return (component + "_icon").c_str(); text: !lambda return icon.c_str(); - if: condition: @@ -181,7 +181,7 @@ api: then: - script.execute: id: set_component_font_color - component_id: !lambda return (component_id + "_icon").c_str(); + component: !lambda return (component + "_icon").c_str(); color: !lambda return (((icon_color[0] & 0xF8) << 8) | ((icon_color[1] & 0xFC) << 3) | (icon_color[2] >> 3)); - if: condition: @@ -189,7 +189,7 @@ api: then: - script.execute: id: set_component_text - component_id: !lambda return (component_id + "_label").c_str(); + component: !lambda return (component + "_label").c_str(); text: !lambda return name.c_str(); - if: condition: @@ -197,7 +197,7 @@ api: then: - script.execute: id: set_component_text - component_id: !lambda return component_id.c_str(); + component: !lambda return component.c_str(); text: !lambda return adjustDecimalSeparator(value, id(mui_decimal_separator)).c_str(); - if: condition: @@ -205,7 +205,7 @@ api: then: - script.execute: id: set_component_font_color - component_id: !lambda return component_id.c_str(); + component: !lambda return component.c_str(); color: !lambda return (((value_color[0] & 0xF8) << 8) | ((value_color[1] & 0xFC) << 3) | (value_color[2] >> 3)); # Wake Up action @@ -844,53 +844,53 @@ script: - id: set_component_font mode: queued parameters: - component_id: string + component: string font: uint8_t then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - - lambda: disp1->set_component_font(component_id.c_str(), font); + - lambda: disp1->set_component_font(component.c_str(), font); - id: set_component_font_color mode: queued parameters: - component_id: string + component: string color: int then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - - lambda: disp1->set_component_font_color(component_id.c_str(), color); + - lambda: disp1->set_component_font_color(component.c_str(), color); - id: set_component_pic mode: queued parameters: - component_id: string + component: string pic: uint8_t then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - - lambda: disp1->set_component_pic(component_id.c_str(), pic); + - lambda: disp1->set_component_pic(component.c_str(), pic); - id: set_component_text mode: queued parameters: - component_id: string + component: string text: string then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - - lambda: disp1->set_component_text(component_id.c_str(), text.c_str()); + - lambda: disp1->set_component_text(component.c_str(), text.c_str()); - id: set_component_value mode: queued parameters: - component_id: string + component: string val: int then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - - lambda: disp1->set_component_value(component_id.c_str(), val); + - lambda: disp1->set_component_value(component.c_str(), val); - id: set_component_visibility mode: queued parameters: page: string - component_id: string + component: string show: bool then: - wait_until: @@ -903,7 +903,7 @@ script: then: - delay: !lambda return (10*disp1->queue_size()+tf_uart->available()); - lambda: |- - disp1->send_command_printf("vis %s,%i", component_id.c_str(), show ? 1 : 0); + disp1->send_command_printf("vis %s,%i", component.c_str(), show ? 1 : 0); - id: !extend set_var_int then: diff --git a/esphome/nspanel_esphome_core_hw_relays.yaml b/esphome/nspanel_esphome_core_hw_relays.yaml index 7e5ec0c0c..8d4cccf0b 100644 --- a/esphome/nspanel_esphome_core_hw_relays.yaml +++ b/esphome/nspanel_esphome_core_hw_relays.yaml @@ -58,11 +58,11 @@ script: then: - script.execute: id: set_component_font_color - component_id: home.chip_relay1 + component: home.chip_relay1 color: !lambda return id(home_relay1_icon_color); - script.execute: id: set_component_font_color - component_id: home.chip_relay2 + component: home.chip_relay2 color: !lambda return id(home_relay2_icon_color); - id: !extend page_home @@ -82,7 +82,7 @@ script: then: - script.execute: id: set_component_text - component_id: home.chip_relay1 + component: home.chip_relay1 text: !lambda 'return relay_1->state ? id(home_relay1_icon) : "\uFFFF";' - if: condition: @@ -90,14 +90,14 @@ script: then: - script.execute: id: set_component_text - component_id: home.chip_relay2 + component: home.chip_relay2 text: !lambda 'return relay_2->state ? id(home_relay2_icon) : "\uFFFF";' - id: !extend set_component_font_color # Defined by nspanel_esphome_core_hw_display.yaml then: - lambda: |- - if (component_id == "home.chip_relay1") id(home_relay1_icon_color) = color; - else if (component_id == "home.chip_relay2") id(home_relay2_icon_color) = color; + if (component == "home.chip_relay1") id(home_relay1_icon_color) = color; + else if (component == "home.chip_relay2") id(home_relay2_icon_color) = color; - id: !extend set_var_bool then: diff --git a/esphome/nspanel_esphome_core_hw_wifi.yaml b/esphome/nspanel_esphome_core_hw_wifi.yaml index 0d1826486..e669e1772 100644 --- a/esphome/nspanel_esphome_core_hw_wifi.yaml +++ b/esphome/nspanel_esphome_core_hw_wifi.yaml @@ -36,11 +36,11 @@ esphome: then: - script.execute: # Update Wi-Fi icon id: set_component_text - component_id: home.wifi_icon + component: home.wifi_icon text: "\uE708" - script.execute: # Update Wi-Fi color id: set_component_font_color - component_id: home.wifi_icon + component: home.wifi_icon color: 63488 script: diff --git a/esphome/nspanel_esphome_core_page_blank.yaml b/esphome/nspanel_esphome_core_page_blank.yaml index 2c53cca57..f3dcb2582 100644 --- a/esphome/nspanel_esphome_core_page_blank.yaml +++ b/esphome/nspanel_esphome_core_page_blank.yaml @@ -32,7 +32,7 @@ script: cmd: 'tm_esphome.en=0' - script.execute: id: set_component_text - component_id: esp_version + component: esp_version text: "FW: ${version}" # ESPHome version - if: condition: @@ -45,12 +45,12 @@ script: then: - script.execute: id: set_component_text - component_id: framework + component: framework text: Arduino else: - script.execute: id: set_component_text - component_id: framework + component: framework text: ESP-IDF - id: !extend page_changed diff --git a/esphome/nspanel_esphome_core_page_boot.yaml b/esphome/nspanel_esphome_core_page_boot.yaml index 10b26475c..aafa84b14 100644 --- a/esphome/nspanel_esphome_core_page_boot.yaml +++ b/esphome/nspanel_esphome_core_page_boot.yaml @@ -38,12 +38,12 @@ script: then: - script.execute: id: set_component_text - component_id: sys_framework + component: sys_framework text: 'Framework: Arduino' else: - script.execute: id: set_component_text - component_id: sys_framework + component: sys_framework text: 'Framework: ESP-IDF' - script.execute: id: boot_progress diff --git a/esphome/nspanel_esphome_core_page_buttons.yaml b/esphome/nspanel_esphome_core_page_buttons.yaml index 6038b5d30..31d79b352 100644 --- a/esphome/nspanel_esphome_core_page_buttons.yaml +++ b/esphome/nspanel_esphome_core_page_buttons.yaml @@ -19,7 +19,7 @@ api: - action: button # yamllint disable-line rule:indentation variables: page: string # Identifier of the page where the button is located. - component_id: string # Unique identifier for the button. + component: string # Unique identifier for the button. state: bool # Determines the button's state, influencing background and other visual aspects. icon: string # Icon codepoint from HASwitchPlate Material Design Icons. Example: "\uE6E8" for mdi:lightbulb-on-outline. icon_color: int[] # RGB color array for the icon. @@ -45,63 +45,63 @@ api: delay(10*disp1->queue_size()+tf_uart->available()); App.feed_wdt(); - disp1->set_component_picc((component_id + "pic").c_str(), state ? 47 : 46); - disp1->set_component_picc((component_id + "bri").c_str(), state ? 47 : 46); - disp1->set_component_picc((component_id + "text").c_str(), state ? 47 : 46); - disp1->set_component_picc((component_id + "icon").c_str(), state ? 47 : 46); + disp1->set_component_picc((component + "pic").c_str(), state ? 47 : 46); + disp1->set_component_picc((component + "bri").c_str(), state ? 47 : 46); + disp1->set_component_picc((component + "text").c_str(), state ? 47 : 46); + disp1->set_component_picc((component + "icon").c_str(), state ? 47 : 46); - script.execute: id: set_component_font - component_id: !lambda return (component_id + "icon").c_str(); + component: !lambda return (component + "icon").c_str(); font: !lambda return icon_font; - lambda: |- delay(10*disp1->queue_size()+tf_uart->available()); App.feed_wdt(); - disp1->set_component_foreground_color((component_id + "bri").c_str(), state ? 10597 : 65535); - disp1->set_component_foreground_color((component_id + "text").c_str(), state ? 10597 : 65535); - disp1->set_component_font_color((component_id + "icon").c_str(), + disp1->set_component_foreground_color((component + "bri").c_str(), state ? 10597 : 65535); + disp1->set_component_foreground_color((component + "text").c_str(), state ? 10597 : 65535); + disp1->set_component_font_color((component + "icon").c_str(), (((icon_color[0] & 0xF8) << 8) | ((icon_color[1] & 0xFC) << 3) | (icon_color[2] >> 3))); - script.execute: id: set_component_text - component_id: !lambda return (component_id + "icon").c_str(); + component: !lambda return (component + "icon").c_str(); text: !lambda return icon.c_str(); - script.execute: id: display_wrapped_text page: !lambda return page.c_str(); - component: !lambda return (component_id + "text").c_str(); + component: !lambda return (component + "text").c_str(); text_to_display: !lambda return label.c_str(); line_length_limit: 10 - script.execute: id: set_component_text - component_id: !lambda return (component_id + "bri").c_str(); + component: !lambda return (component + "bri").c_str(); text: !lambda |- return (strcmp(bri.c_str(), "0") == 0) ? " " : bri.c_str(); - script.execute: id: set_component_visibility page: !lambda return page.c_str(); - component_id: !lambda return (component_id + "pic").c_str(); + component: !lambda return (component + "pic").c_str(); show: true - script.execute: id: set_component_visibility page: !lambda return page.c_str(); - component_id: !lambda return (component_id + "icon").c_str(); + component: !lambda return (component + "icon").c_str(); show: true - script.execute: id: set_component_visibility page: !lambda return page.c_str(); - component_id: !lambda return (component_id + "text").c_str(); + component: !lambda return (component + "text").c_str(); show: true - script.execute: id: set_component_visibility page: !lambda return page.c_str(); - component_id: !lambda return (component_id + "bri").c_str(); + component: !lambda return (component + "bri").c_str(); show: true - script.execute: id: set_component_visibility page: !lambda return page.c_str(); - component_id: !lambda return component_id.c_str(); + component: !lambda return component.c_str(); show: true script: diff --git a/esphome/nspanel_esphome_core_page_entities.yaml b/esphome/nspanel_esphome_core_page_entities.yaml index d803e6981..f6bfd0a12 100644 --- a/esphome/nspanel_esphome_core_page_entities.yaml +++ b/esphome/nspanel_esphome_core_page_entities.yaml @@ -104,9 +104,9 @@ script: } // Decide which font to use based on adjusted length if (adjusted_length > 8.0 and adjusted_length <= 12.0) { - disp1->set_component_font(component_id.c_str(), 1); + disp1->set_component_font(component.c_str(), 1); } else if (adjusted_length > 12.0) { - disp1->set_component_font(component_id.c_str(), 0); + disp1->set_component_font(component.c_str(), 0); } - id: !extend set_var_int diff --git a/esphome/nspanel_esphome_core_page_home.yaml b/esphome/nspanel_esphome_core_page_home.yaml index 36c4b1372..9941e9cb7 100644 --- a/esphome/nspanel_esphome_core_page_home.yaml +++ b/esphome/nspanel_esphome_core_page_home.yaml @@ -48,19 +48,19 @@ script: - lambda: id(home_chip_font_id) = chip_font; - script.execute: id: set_component_font - component_id: home.wifi_icon + component: home.wifi_icon font: !lambda return chip_font; - script.execute: id: set_component_font - component_id: home.chip_relay1 + component: home.chip_relay1 font: !lambda return chip_font; - script.execute: id: set_component_font - component_id: home.chip_relay2 + component: home.chip_relay2 font: !lambda return chip_font; - script.execute: id: set_component_font - component_id: home.chip_climate + component: home.chip_climate font: !lambda return chip_font; - repeat: count: 7 diff --git a/esphome/nspanel_esphome_core_page_notification.yaml b/esphome/nspanel_esphome_core_page_notification.yaml index 04b137533..fc5c57927 100644 --- a/esphome/nspanel_esphome_core_page_notification.yaml +++ b/esphome/nspanel_esphome_core_page_notification.yaml @@ -34,7 +34,7 @@ api: - script.execute: id: set_component_visibility page: home - component_id: bt_notific + component: bt_notific show: false # Displays a notification message on the screen, useful for alerts or informational updates. @@ -46,7 +46,7 @@ api: - script.execute: id: set_component_visibility page: home - component_id: bt_notific + component: bt_notific show: true - script.execute: id: goto_page @@ -54,7 +54,7 @@ api: - script.execute: timer_reset_all - script.execute: id: set_component_text - component_id: notification.notifi_label + component: notification.notifi_label text: !lambda return label.c_str(); - script.execute: id: display_wrapped_text diff --git a/esphome/nspanel_esphome_core_page_qrcode.yaml b/esphome/nspanel_esphome_core_page_qrcode.yaml index 222916de3..002c48fe6 100644 --- a/esphome/nspanel_esphome_core_page_qrcode.yaml +++ b/esphome/nspanel_esphome_core_page_qrcode.yaml @@ -23,11 +23,11 @@ api: - script.execute: id: set_component_visibility page: home - component_id: bt_qrcode + component: bt_qrcode show: !lambda return not id(qrcode_string).empty(); - script.execute: id: set_component_text - component_id: qrcode.qrcode_label + component: qrcode.qrcode_label text: !lambda return title.c_str(); - if: condition: @@ -76,7 +76,7 @@ script: - script.execute: id: set_component_visibility page: home - component_id: bt_qrcode + component: bt_qrcode show: !lambda return id(qrcode_enabled); # Load the QRCode page diff --git a/esphome/nspanel_esphome_core_page_screensaver.yaml b/esphome/nspanel_esphome_core_page_screensaver.yaml index ac8726705..85ffbccd1 100644 --- a/esphome/nspanel_esphome_core_page_screensaver.yaml +++ b/esphome/nspanel_esphome_core_page_screensaver.yaml @@ -60,7 +60,7 @@ script: - id: !extend set_component_font_color # Defined by nspanel_esphome_core_hw_display.yaml then: - lambda: |- - if (component_id == "screensaver.text") id(screensaver_display_time_color) = color; + if (component == "screensaver.text") id(screensaver_display_time_color) = color; - id: !extend set_var_bool then: diff --git a/esphome/nspanel_esphome_core_versioning.yaml b/esphome/nspanel_esphome_core_versioning.yaml index ad5bfaf2c..defbc0657 100644 --- a/esphome/nspanel_esphome_core_versioning.yaml +++ b/esphome/nspanel_esphome_core_versioning.yaml @@ -127,7 +127,7 @@ script: log_message: "ESPHome FW v${version}" - script.execute: id: set_component_text - component_id: ver_firmware + component: ver_firmware text: "Firmware: ${version}" - if: condition: diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index fa7f6bdfc..58d60563b 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -8286,14 +8286,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.left_bt_text + component: home.left_bt_text color: !input left_button_color continue_on_error: true ### LABEL Font ### - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.left_bt_text + component: home.left_bt_text txt: '{{ hardware.buttons.left.name }}' continue_on_error: true @@ -8304,14 +8304,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.right_bt_text + component: home.right_bt_text color: !input right_button_color continue_on_error: true ### LABEL Font ### - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.right_bt_text + component: home.right_bt_text txt: '{{ hardware.buttons.right.name }}' continue_on_error: true @@ -8464,7 +8464,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.chip_relay1 + component: home.chip_relay1 color: !input relay01_icon_color continue_on_error: true @@ -8483,7 +8483,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.chip_relay2 + component: home.chip_relay2 color: !input relay02_icon_color continue_on_error: true @@ -8587,7 +8587,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.bt_entities + component: home.bt_entities txt: > {{ all_icons[bt_entities_icon.split("mdi:")[1]] @@ -8598,7 +8598,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.bt_entities + component: home.bt_entities color: !input home_button06_icon_color continue_on_error: true @@ -8647,7 +8647,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.date + component: home.date color: !input date_label_color continue_on_error: true @@ -8655,7 +8655,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.time + component: home.time color: !input time_label_color continue_on_error: true @@ -8665,13 +8665,13 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.indr_temp + component: home.indr_temp color: !input home_indoor_temp_label_color continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.indr_temp_icon + component: home.indr_temp_icon txt: > {{ all_icons[home_indoor_temp_icon.split("mdi:")[1]] @@ -8682,7 +8682,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.indr_temp_icon + component: home.indr_temp_icon color: !input home_indoor_temp_icon_color continue_on_error: true @@ -8690,7 +8690,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.outdoor_temp + component: home.outdoor_temp color: !input home_outdoor_temp_label_color continue_on_error: true @@ -8722,13 +8722,13 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}' color: '{{ entity.icon_color if entity.icon_color is defined else [200, 204, 200] }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' txt: '{{ entity.icon if entity.icon is defined else all_icons.blank }}' continue_on_error: true @@ -8748,7 +8748,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: 'home.{{ repeat.item.component }}' + component: 'home.{{ repeat.item.component }}' color: '{{ repeat.item.icon_color_rgb }}' continue_on_error: true @@ -8798,7 +8798,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.bt_qrcode + component: home.bt_qrcode txt: > {{ all_icons[bt_bt_qrcode_icon.split("mdi:")[1]] @@ -8809,7 +8809,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.bt_qrcode + component: home.bt_qrcode color: !input home_button05_icon_color continue_on_error: true @@ -8868,7 +8868,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: screensaver.text + component: screensaver.text color: !input screensaver_display_time_font_color continue_on_error: true @@ -8877,14 +8877,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: settings.lbl_reboot + component: settings.lbl_reboot txt: '{{ mui[language].settings.reboot }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: settings.lbl_brightness + component: settings.lbl_brightness txt: '{{ mui[language].settings.brightness }}' continue_on_error: true @@ -8910,7 +8910,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.bt_utilities + component: home.bt_utilities txt: > {{ all_icons[bt_utilities_icon.split("mdi:")[1]] @@ -8921,7 +8921,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: home.bt_utilities + component: home.bt_utilities color: !input home_button08_icon_color continue_on_error: true - *delay_default @@ -9103,7 +9103,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.outdoor_temp + component: home.outdoor_temp txt: '{{ outdoor_temp | round(1) ~ temperature_units }}' continue_on_error: true @@ -9118,14 +9118,14 @@ action: - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: home - component_id: indr_temp + component: indr_temp show: '{{ home_indoor_temp_visible }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: home - component_id: indr_temp_icon + component: indr_temp_icon show: '{{ home_indoor_temp_visible }}' continue_on_error: true - condition: '{{ home_indoor_temp_visible and not embedded_indoor_temperature }}' @@ -9148,7 +9148,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: home.indr_temp + component: home.indr_temp txt: '{{ indoor_temp.state | round(1) ~ indoor_temp_units if not embedded_indoor_temperature else "" }}' continue_on_error: true @@ -9177,7 +9177,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: home - component_id: bt_notific + component: bt_notific icon: '{{ notification_icon }}' icon_color: '{{ notification_icon_color_unread if notification_unread_state else notification_icon_color_normal }}' visible: '{{ notification_visible }}' @@ -9202,7 +9202,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: home - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' icon: '{{ entity.icon if entity.icon is defined else all_icons.blank }}' icon_color: '{{ entity.icon_color if entity.icon_color is defined else [0, 0, 0] }}' visible: true @@ -9211,7 +9211,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: home - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' icon: '{{ all_icons.blank }}' icon_color: '{{ [0, 0, 0] }}' visible: false @@ -9232,7 +9232,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: home - component_id: chip_climate + component: chip_climate icon: '{{ entity.icon if entity.icon is defined else "" }}' icon_color: '{{ entity.icon_color if entity.icon_color is defined else [] }}' visible: > @@ -9309,7 +9309,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: home - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' icon: '{{ entity.icon if chip_visible and entity.icon is defined else "" }}' icon_color: > {{ @@ -9371,7 +9371,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' txt: '{{ entity.icon }}' continue_on_error: true - if: '{{ entity.icon_color != [200, 204, 200] }}' @@ -9379,14 +9379,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' color: '{{ entity.icon_color }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}' txt: &value_with_unit_and_translations > {{ ( @@ -9439,7 +9439,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: page_label + component: page_label txt: '{{ buttons_pages.labels[event_page] | string }}' continue_on_error: true @@ -9447,7 +9447,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_val' data: - component_id: confirm + component: confirm val: '{{ confirm_value }}' continue_on_error: true @@ -9499,7 +9499,7 @@ action: - action: 'esphome.{{ nspanel_name }}_button' data: page: '{{ repeat.item.page }}' - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' state: '{{ btn_state if btn_state else false }}' icon: '{{ entity.icon }}' icon_color: '{{ entity.icon_color }}' @@ -9516,7 +9516,7 @@ action: - action: 'esphome.{{ nspanel_name }}_button' data: page: '{{ repeat.item.page }}' - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' state: false icon: '{{ entity.icon }}' icon_color: '{{ nextion.color.grey_light }}' @@ -9586,19 +9586,19 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_val' data: - component_id: light.lightslider + component: light.lightslider val: '{{ curr_brightness }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: light.light_value + component: light.light_value txt: '{{ curr_brightness }}%' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: light.light_value_2 + component: light.light_value_2 txt: '{{ curr_brightness }}%' continue_on_error: true @@ -9620,19 +9620,19 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: light.temp_value + component: light.temp_value txt: '{{ curr_color_temp }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: light.temp_value_2 + component: light.temp_value_2 txt: '{{ curr_color_temp }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_val' data: - component_id: light.tempslider + component: light.tempslider val: '{{ curr_color_temp }}' continue_on_error: true - *delay_default @@ -9648,28 +9648,28 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: power_button + component: power_button color: [192, 192, 192] continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: light - component_id: temp_button + component: temp_button show: true continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: light - component_id: temp_value_2 + component: temp_value_2 show: true continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: light - component_id: temp_touch + component: temp_touch show: true continue_on_error: true @@ -9680,14 +9680,14 @@ action: - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: light - component_id: color_button + component: color_button show: true continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: light - component_id: color_touch + component: color_touch show: true continue_on_error: true @@ -9730,13 +9730,13 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: cover.cover_open + component: cover.cover_open txt: '{{ cover_icons.open }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: cover.cover_close + component: cover.cover_close txt: '{{ cover_icons.close }}' continue_on_error: true @@ -9744,13 +9744,13 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_val' data: - component_id: cover.coverslider + component: cover.coverslider val: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: cover.cover_value + component: cover.cover_value txt: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }} %' continue_on_error: true @@ -9798,21 +9798,21 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: cover.battery_value + component: cover.battery_value txt: '{{ battery_level }} %' continue_on_error: true ### ICON Battery Font Color ### - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: cover.battery_icon + component: cover.battery_icon color: '{{ nextion.color.grey_super_light }}' continue_on_error: true ### ICON Battery Font ### - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: cover.battery_icon + component: cover.battery_icon txt: '{{ all_icons[battery_icon] }}' continue_on_error: true @@ -9847,27 +9847,27 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: bt_oscillate + component: bt_oscillate txt: '{{ all_icons["autorenew"] if state_attr(fan_entity, "oscillating") | default(false) else all_icons["autorenew-off"] }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: fan.bt_oscillate + component: fan.bt_oscillate color: '{{ nextion.color.grey_white }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: fan - component_id: bt_oscillate + component: bt_oscillate show: true continue_on_error: true - condition: '{{ fan.steps > 0 and fan.supported_features | bitwise_and(1) > 0 }}' # Set speed - *delay_default - action: 'esphome.{{ nspanel_name }}_component_val' data: - component_id: fanslider + component: fanslider val: '{{ ((fan.percentage / 100) * fan.steps) | round(0) | int(0) }}' continue_on_error: true - *delay_default @@ -9878,25 +9878,25 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: fan_value + component: fan_value txt: '{{ fan.percentage }}%' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: fan.button_up + component: fan.button_up color: '{{ nextion.color.grey_white if fan.percentage < 100 else nextion.color.grey_dark }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: fan.button_down + component: fan.button_down color: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: power_button + component: power_button color: [192, 192, 192] continue_on_error: true @@ -10062,7 +10062,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: page_label + component: page_label txt: '{{ state_attr(climate_entity, "friendly_name") }}' continue_on_error: true @@ -10119,7 +10119,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' txt: '{{ var_icon }}' continue_on_error: true - if: '{{ repeat.item.label_color_rgb != [200, 204, 200] }}' @@ -10127,7 +10127,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}' color: '{{ repeat.item.label_color_rgb }}' continue_on_error: true @@ -10202,7 +10202,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: 'climate.{{ repeat.item.component }}' + component: 'climate.{{ repeat.item.component }}' color: > {{ nextion.color[repeat.item.color] @@ -10214,7 +10214,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: 'climate.{{ repeat.item.component }}' + component: 'climate.{{ repeat.item.component }}' txt: '{{ all_icons[repeat.item.icon] }}' continue_on_error: true ### Enable button click ### @@ -10222,7 +10222,7 @@ action: - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: climate - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' show: true continue_on_error: true @@ -10255,14 +10255,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' color: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' txt: '{{ entity.icon }}' continue_on_error: true ### Enable button click ### @@ -10270,7 +10270,7 @@ action: - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: climate - component_id: '{{ repeat.item.component }}' + component: '{{ repeat.item.component }}' show: true continue_on_error: true @@ -10288,7 +10288,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: page_label + component: page_label txt: '{{ entities_pages.labels[event_page] }}' continue_on_error: true ##### Entities ##### @@ -10315,7 +10315,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_value' data: - component_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' + component: '{{ repeat.item.page }}.{{ repeat.item.component }}' icon: '{{ entity.icon if entitypages_show_entities_icons else "" }}' icon_color: [] name: '{{ entity.name }}' @@ -10378,7 +10378,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.day' + component: '{{ page_name }}.day' txt: '{{ (dict.values(mui[language].relative_day) | list)[page_index] }}' continue_on_error: true @@ -10386,7 +10386,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.date' + component: '{{ page_name }}.date' txt: > {{ as_timestamp(now() + timedelta(days= (page_index))) @@ -10802,7 +10802,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.temperature' ### Temperature MIN/MAX ### + component: '{{ page_name }}.temperature' ### Temperature MIN/MAX ### txt: '{{ temperature_string }}' continue_on_error: true @@ -10813,20 +10813,20 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.value0{{ repeat.index }}' + component: '{{ page_name }}.value0{{ repeat.index }}' txt: '{{ repeat.item.value }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.value0{{ repeat.index }}_icon' + component: '{{ page_name }}.value0{{ repeat.index }}_icon' txt: '{{ repeat.item.icon }}' continue_on_error: true else: &forecast_unavailable - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ page_name }}.value01' + component: '{{ page_name }}.value01' txt: '{{ mui[language].unavailable }}' continue_on_error: true else: *forecast_unavailable @@ -10842,7 +10842,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_value' data: - component_id: utilities.title + component: utilities.title icon: '{{ all_icons[page_icon] if page_icon in all_icons else all_icons.gauge }}' icon_color: [] name: '' @@ -10880,7 +10880,7 @@ action: - action: 'esphome.{{ nspanel_name }}_icon' data: page: utilities - component_id: '{{ repeat.item.name }}_icon' + component: '{{ repeat.item.name }}_icon' icon: '{{ all_icons[icon_code] if icon_code in all_icons else "" }}' icon_color: '{{ repeat.item.color }}' visible: '{{ icon_code in all_icons }}' @@ -10891,20 +10891,20 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: '{{ repeat.item.name }}_label' + component: '{{ repeat.item.name }}_label' txt: '{{ repeat.item.label }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.name }}_label' + component: '{{ repeat.item.name }}_label' color: '{{ repeat.item.color }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: utilities - component_id: '{{ repeat.item.name ~ "_label" }}' + component: '{{ repeat.item.name ~ "_label" }}' show: true continue_on_error: true @@ -10956,14 +10956,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.name }}' + component: '{{ repeat.item.name }}' color: '{{ repeat.item.color }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: utilities - component_id: '{{ repeat.item.name }}' + component: '{{ repeat.item.name }}' show: true continue_on_error: true - if: '{{ value2_enabled }}' @@ -10971,14 +10971,14 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_color' data: - component_id: '{{ repeat.item.name }}b' + component: '{{ repeat.item.name }}b' color: '{{ repeat.item.color }}' continue_on_error: true - *delay_default - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: utilities - component_id: '{{ repeat.item.name ~ "b" }}' + component: '{{ repeat.item.name ~ "b" }}' show: true continue_on_error: true - alias: Utilities - Line @@ -11010,7 +11010,7 @@ action: - action: 'esphome.{{ nspanel_name }}_component_visibility' data: page: utilities - component_id: '{{ repeat.item.name ~ "_line" }}' + component: '{{ repeat.item.name ~ "_line" }}' show: true continue_on_error: true @@ -11056,7 +11056,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: icon_state + component: icon_state txt: '{{ entity.icon }}' continue_on_error: true - if: '{{ entity is defined and entity.name is defined and entity.name is string and entity.name | length > 0 }}' @@ -11064,7 +11064,7 @@ action: - *delay_default - action: 'esphome.{{ nspanel_name }}_component_text' data: - component_id: page_label + component: page_label txt: '{{ entity.name }}' continue_on_error: true - alias: Custom action - Left