From c8884bd1318d51f6de66829a3c2c624bf447b0e1 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:36:20 +0100 Subject: [PATCH] Fix calls to icon action --- nspanel_blueprint.yaml | 158 ++++++++++++++++++++++++++++------------- 1 file changed, 107 insertions(+), 51 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index b5d0bc65..09cf81ea 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -52,9 +52,39 @@ blueprint: default: en selector: language: - languages: > - [en, bg, hr, cs, da, nl, et, fi, fr, de, el, he, hu, id, it, ja, - ko, lv, lt, nb, pl, pt, ro, ru, sk, sl, es, sv, th, tr, uk, zh-tw] + languages: + - en + - bg + - hr + - cs + - da + - nl + - et + - fi + - fr + - de + - el + - he + - hu + - id + - it + - ja + - ko + - lv + - lt + - nb + - pl + - pt + - ro + - ru + - sk + - sl + - es + - sv + - th + - tr + - uk + - zh-tw date_format: name: Date Format description: "Select the format for date to display." @@ -3190,7 +3220,8 @@ blueprint: selector: *color_selector utilities_page_cursor_width: name: Utilities Page - Cursor Width - description: "Set the width of cursors indicating utility flows. Use 0 for no cursor, or 255 for automatic sizing." + description: > + Set the width of cursors indicating utility flows. Use 0 for no cursor, or 255 for automatic sizing. default: 255 selector: number: @@ -3575,7 +3606,8 @@ blueprint: **Important!** 1. *Keeping the display always "on" may increase the temperature on your panel, - requiring adjustments on the **Temperature correction** control to keep consistence with the environment temperature.* + requiring adjustments on the **Temperature correction** control + to keep consistence with the environment temperature.* 2. *Please set **Display Brightness Sleep** accordingly under the device's page (Settings > Devices & services > ESPHome) to have the text visible.* @@ -3682,7 +3714,8 @@ blueprint: description: > *General* - *Which default color should be used for icons when the state is **ON** while a custom color is not selected and the domain does not provides a state-based color?* + *Which default color should be used for icons when the state is **ON** + while a custom color is not selected and the domain does not provides a state-based color?* default: [200, 204, 200] selector: *color_selector icon_color_fallback_off: @@ -3696,7 +3729,8 @@ blueprint: delay: name: Command Delay to Prevent Overload description: > - Adjusts the delay between sequential commands to the Nextion display, preventing overload and synchronization issues. + Adjusts the delay between sequential commands to the Nextion display, + preventing overload and synchronization issues. While increasing delay enhances stability, it may slow down page rendering. default: 10 selector: @@ -3710,15 +3744,18 @@ blueprint: name: Nextion TFT File Folder (Optional) description: > Specify the path to the folder containing the Nextion TFT file. - Note that configuring the [Folder Watcher](https://www.home-assistant.io/integrations/folder_watcher/) in `configuration.yaml` is required for this path to be monitored. + Note that configuring the [Folder Watcher](https://www.home-assistant.io/integrations/folder_watcher/) in + `configuration.yaml` is required for this path to be monitored. With this, the Blueprint will trigger a TFT upload every time a file on that folder changed. **Note:** - - This is to be used together with the option `nextion_upload_tft` on the "Update TFT Display - Model" option on the device's page. + - This is to be used together with the option `nextion_upload_tft` on the "Update TFT Display - Model" + option on the device's page. - - This is a relative path on Home Assistant file system pointing to the www folder where you store your `nspanel_xxx.tft` files. Please do not use the url here. + - This is a relative path on Home Assistant file system pointing to the www folder where you store your + `nspanel_xxx.tft` files. Please do not use the url here. default: "" selector: text: {} @@ -4632,7 +4669,12 @@ actions: # }} date_format_temp: !input 'date_format' # Avoid breaking change for existing users with legacy type format - date_format: '{{ date_format_temp if date_format_temp not in ["%d.%m", "%d/%m", "%-d/%-m", "%-m/%-d"] else "%A, " ~ date_format_temp }}' + date_format: > + {{ + date_format_temp + if date_format_temp not in ["%d.%m", "%d/%m", "%-d/%-m", "%-m/%-d"] + else "%A, " ~ date_format_temp + }} sun_entity_input: !input sun_entity sun_entity: > @@ -4641,9 +4683,19 @@ actions: if sun_entity_input is string and sun_entity_input.split("sun.") | count == 2 - else ((states.sun | map(attribute="entity_id") | list | first) if states.sun | selectattr("entity_id", "defined") | list | count > 0 else None) + else + ( + (states.sun | map(attribute="entity_id") | list | first) + if states.sun | selectattr("entity_id", "defined") | list | count > 0 + else None + ) + }} + sun_is_up: > + {{ + is_state(sun_entity, "above_horizon") + if sun_entity is string and sun_entity.split("sun.") | count == 2 and has_value(sun_entity) + else true }} - sun_is_up: '{{ is_state(sun_entity, "above_horizon") if sun_entity is string and sun_entity.split("sun.") | count == 2 and has_value(sun_entity) else true }}' # yamllint disable rule:line-length rule:braces device_class_icons: @@ -4691,7 +4743,7 @@ actions: camera: "\uE566" # mdi:video climate: "\uE392" # mdi:thermostat configurator: "\uE492" # mdi:cog - conversation: "\uE36B" # mdi:microphone (HA uses mdi:microphone-message, not available for Nextion) + conversation: "\uE36B" # mdi:microphone (HA uses mdi:microphone-message, n/a for Nextion) counter: "\uE198" # mdi:counter cover: "\uE0AB" # mdi:blinds device_tracker: "\uF2A9" # mdi:lan-check (I couldn't find the default icon in HA) @@ -4708,7 +4760,7 @@ actions: image: "\uE2E8" # mdi:image image_processing: "\uE2F3" # mdi:image-filter-frames input_boolean: "\uEA19" # mdi:toggle-switch-outline - input_button: "\uF2A7" # mdi:gesture-tap-button (HA uses mdi:button-pointer, not available for Nextion) + input_button: "\uF2A7" # mdi:gesture-tap-button (HA uses mdi:button-pointer, n/a for Nextion) input_datetime: "\uE0EF" # mdi:calendar-clock input_number: "\uE444" # mdi:ray-vertex input_select: "\uE278" # mdi:format-list-bulleted @@ -4731,14 +4783,14 @@ actions: sensor: "\uE207" # mdi:eye, simple_alarm: "\uE099" # mdi:bell siren: "\uE0E5" # mdi:bullhorn - stt: "\uE36B" # mdi:microphone (HA uses mdi:microphone-message, not available for Nextion) + stt: "\uE36B" # mdi:microphone (HA uses mdi:microphone-message, n/a for Nextion) sun: '{{ "\uE598" if sun_is_up else "\uE593" }}' # mdi:weather-sunny or mdi:weather-night switch: "\uE97D" # mdi:light-switch text: "\uE60D" # mdi:form-textbox todo: "\uF0D3" # mdi:clipboard-list time: "\uE953" # mdi:clock timer: "\uE51A" # mdi:timer-outline - tts: "\uE4C2" # mdi:speaker (HA uses mdi:speaker-message, not available for Nextion) + tts: "\uE4C2" # mdi:speaker (HA uses mdi:speaker-message, n/a for Nextion) update: "\uE3D2" # mdi:package updater: "\uE166" # mdi:cloud-upload vacuum: "\uE70C" # mdi:robot-vacuum @@ -7940,9 +7992,11 @@ actions: media_player_update_delay: !input 'media_player_update_delay' ##### ENUMs ##### - # yamllint disable rule:truthy rule:line-length rule:comments-indentation + # yamllint disable rule:truthy rule:comments-indentation enum: - ColorMode: # Possible light color modes. - https://github.com/home-assistant/core/blob/dev/homeassistant/components/light/__init__.py + # Possible light color modes. + # https://github.com/home-assistant/core/blob/dev/homeassistant/components/light/__init__.py + ColorMode: UNKNOWN: "[]" ONOFF: "[]" BRIGHTNESS: "[]" @@ -7953,12 +8007,14 @@ actions: RGBW: "[]" RGBWW: "[]" WHITE: "[]" - HVACMode: # Possible HVAC modes. - https://github.com/home-assistant/core/blob/dev/homeassistant/components/climate/const.py#L13 + # Possible HVAC modes. + # https://github.com/home-assistant/core/blob/dev/homeassistant/components/climate/const.py#L13 + HVACMode: "OFF": "[]" # All activity disabled / Device is off/standby HEAT: "[]" # Heating COOL: "[]" # Cooling HEAT_COOL: "[]" # The device supports heating/cooling to a range - AUTO: "[]" # The temperature is set based on a schedule, learned behavior, AI or some other related mechanism. User is not able to adjust the temperature + AUTO: "[]" # User is not able to adjust the temperature DRY: "[]" # Device is in Dry/Humidity mode FAN_ONLY: "[]" # Only the fan is on, not fan and another mode like cool HVACMode_bits: @@ -8569,8 +8625,8 @@ actions: if relay1_icon.split("mdi:")[1] in all_icons else all_icons["numeric-1-box-outline"] }} - icon_font: '{{ home_page.chip_font_size }}' - icon_color: > + font: '{{ home_page.chip_font_size }}' + color: > {{ relay1_icon_color if relay1_icon_color is sequence and relay1_icon_color | length == 3 @@ -8591,8 +8647,8 @@ actions: if relay2_icon.split("mdi:")[1] in all_icons else all_icons["numeric-2-box-outline"] }} - icon_font: '{{ home_page.chip_font_size }}' - icon_color: > + font: '{{ home_page.chip_font_size }}' + color: > {{ relay2_icon_color if relay2_icon_color is sequence and relay2_icon_color | length == 3 @@ -8858,8 +8914,8 @@ actions: if bt_entities_icon is string and bt_entities_icon.split("mdi:")[1] in all_icons else all_icons["format-list-bulleted-square"] }} - icon_font: !input custom_buttons_font_size - icon_color: > + font: !input custom_buttons_font_size + color: > {{ bt_entities_icon_color if @@ -8970,8 +9026,8 @@ actions: home_indoor_temp_icon.split("mdi:")[1] in all_icons else all_icons.thermometer }} - icon_font: -1 - icon_color: !input home_indoor_temp_icon_color + font: -1 + color: !input home_indoor_temp_icon_color visible: '{{ home_indoor_temp_visible }}' continue_on_error: true @@ -9055,8 +9111,8 @@ actions: page: '{{ repeat.item.page }}' component: '{{ repeat.item.component }}_icon' icon: '{{ entity.icon }}' - icon_font: -1 - icon_color: > + font: -1 + color: > {{ entity.icon_color if @@ -9094,8 +9150,8 @@ actions: page: '{{ repeat.item.page }}' component: '{{ repeat.item.component }}_icon' icon: '{{ all_icons.blank }}' - icon_font: -1 - icon_color: [0, 0, 0] + font: -1 + color: [0, 0, 0] visible: false continue_on_error: true @@ -9174,8 +9230,8 @@ actions: page: home component: '{{ repeat.item.component }}' icon: '{{ entity.icon if chip_visible and entity.icon is defined else "" }}' - icon_font: '{{ home_page.chip_font_size }}' - icon_color: > + font: '{{ home_page.chip_font_size }}' + color: > {{ entity.icon_color if @@ -9193,8 +9249,8 @@ actions: page: home component: '{{ repeat.item.component }}' icon: '{{ all_icons.blank }}' - icon_font: '{{ home_page.chip_font_size }}' - icon_color: [0, 0, 0] + font: '{{ home_page.chip_font_size }}' + color: [0, 0, 0] visible: false continue_on_error: true @@ -9220,8 +9276,8 @@ actions: page: home 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] }}' - icon_font: !input custom_buttons_font_size + color: '{{ entity.icon_color if entity.icon_color is defined else [0, 0, 0] }}' + font: !input custom_buttons_font_size visible: true continue_on_error: true else: @@ -9230,8 +9286,8 @@ actions: page: home component: '{{ repeat.item.component }}' icon: '{{ all_icons.blank }}' - icon_color: [0, 0, 0] - icon_font: !input custom_buttons_font_size + color: [0, 0, 0] + font: !input custom_buttons_font_size visible: false continue_on_error: true @@ -9272,7 +9328,7 @@ actions: if bt_bt_qrcode_icon is string and bt_bt_qrcode_icon.split("mdi:")[1] in all_icons else all_icons["qrcode-scan"] }} - icon_color: > + color: > {{ bt_qrcode_icon_color if @@ -9282,7 +9338,7 @@ actions: else [0, 0, 0] }} - icon_font: !input custom_buttons_font_size + font: !input custom_buttons_font_size visible: '{{ qrcode_enabled }}' continue_on_error: true @@ -9428,8 +9484,8 @@ actions: if bt_utilities_icon is string and bt_utilities_icon.split("mdi:")[1] in all_icons else all_icons.gauge }} - icon_color: !input home_button08_icon_color - icon_font: !input custom_buttons_font_size + color: !input home_button08_icon_color + font: !input custom_buttons_font_size visible: !input utilities_enabled continue_on_error: true @@ -9683,13 +9739,13 @@ actions: page: home component: bt_notific icon: '{{ notification_icon }}' - icon_color: > + color: > {{ notification_icon_color_unread if notification_unread_state else notification_icon_color_normal }} - icon_font: !input custom_buttons_font_size + font: !input custom_buttons_font_size visible: '{{ notification_visible }}' continue_on_error: true @@ -9721,8 +9777,8 @@ actions: page: home component: chip_climate icon: '{{ entity.icon if entity.icon is defined else "" }}' - icon_color: '{{ entity.icon_color if entity.icon_color is defined else [] }}' - icon_font: '{{ home_page.chip_font_size }}' + color: '{{ entity.icon_color if entity.icon_color is defined else [] }}' + font: '{{ home_page.chip_font_size }}' visible: > {{ entity_has_value and @@ -11258,8 +11314,8 @@ actions: page: utilities component: '{{ repeat.item.name }}_icon' icon: '{{ all_icons[icon_code] if icon_code in all_icons else "" }}' - icon_color: '{{ repeat.item.color }}' - icon_font: -1 + color: '{{ repeat.item.color }}' + font: -1 visible: '{{ icon_code in all_icons }}' continue_on_error: true - alias: Utilities - Label