diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 57fae20..81dda6c 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -15,8 +15,9 @@ substitutions: ota_password: ${wifi_password} temp_units: "°C" invalid_cooldown: "100ms" + bytes_per_char: "1" ##### DON'T CHANGE THIS ###### - version: "4.3.2" + version: "4.3.3d1" ############################## ##### External components ##### @@ -339,6 +340,7 @@ api: screensaver_time_font: int # Specifies the font id for the screensaver time display. screensaver_time_color: int[] # RGB color for the screensaver time display, e.g., [165, 42, 42] for reddish-brown. decimal_separator: string # The char to be used as decimal separator. + # bytes_per_char: init then: - if: condition: @@ -354,6 +356,7 @@ api: screensaver_time_font: !lambda return screensaver_time_font; screensaver_time_color: !lambda return screensaver_time_color; decimal_separator: !lambda return decimal_separator; + # bytes_per_char: !lambda return bytes_per_char; - script.wait: global_settings - lambda: blueprint_status->publish_state(int(blueprint_status->raw_state) | (1 << 5)); @@ -985,6 +988,11 @@ display: ##### START - GLOBALS CONFIGURATION ##### globals: + - id: mui_bytes_per_char + type: uint8_t + restore_value: true + initial_value: ${bytes_per_char} + ###### Buttons settings ###### # Bit # Settings # # 0 # Left Bt - Enabled # @@ -2029,12 +2037,12 @@ script: } else { while (startPos < text_to_display.length()) { while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } - int endPos = startPos + line_length_limit; + int endPos = startPos + (line_length_limit * id(mui_bytes_per_char)); if (endPos >= text_to_display.length()) endPos = text_to_display.length(); else { while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; } - if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word + if (endPos == startPos) endPos = startPos + (line_length_limit * id(mui_bytes_per_char)); // Handle case of long word } wrappedText += text_to_display.substr(startPos, endPos-startPos); if (endPos < text_to_display.length()) @@ -2059,6 +2067,7 @@ script: screensaver_time_font: int screensaver_time_color: int32_t[] decimal_separator: string + # bytes_per_char: int then: - lambda: |- if (!id(is_uploading_tft)) { @@ -2070,6 +2079,7 @@ script: // MUI strings id(mui_please_confirm_global) = mui_please_confirm; id(mui_unavailable_global) = mui_unavailable; + // id(mui_bytes_per_char) = bytes_per_char; // Screen saver page (sleep) id(screensaver_display_time) = screensaver_time; diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index eb4b8a5..3dc1e2f 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -10,7 +10,7 @@ blueprint: description: > # NSPanel Configuration via Blueprint: Complete UI-Based Setup - **Version**: v4.3.2 + **Version**: v4.3.3d1 This project enables comprehensive configuration of your NSPanel through a Blueprint featuring a user interface. @@ -4209,7 +4209,7 @@ condition: action: - variables: ##### GENERAL ##### - blueprint_version: '4.3.2' + blueprint_version: '4.3.3d1' nspanel_name: > {{ trigger.event.data.device_name @@ -4387,6 +4387,7 @@ action: mui: ar: # Arabic + bytes_per_char: 2 weekdays: mon: الاثنين tue: الثلاثاء @@ -4462,6 +4463,7 @@ action: am: صباحاً pm: مساءً bg: # Bulgarian + bytes_per_char: 1 weekdays: mon: Понеделник tue: Вторник @@ -4537,6 +4539,7 @@ action: am: AM pm: PM cs: # Czech + bytes_per_char: 1 weekdays: mon: Pondělí tue: Úterý @@ -4612,6 +4615,7 @@ action: am: dop. pm: odp. da: # Danish + bytes_per_char: 1 weekdays: mon: Mandag tue: Tirsdag @@ -4687,6 +4691,7 @@ action: am: FM pm: EM de: # German + bytes_per_char: 1 weekdays: mon: Montag tue: Dienstag @@ -4762,6 +4767,7 @@ action: am: vorm. pm: nachm. el: # Greek + bytes_per_char: 2 weekdays: mon: Δευτέρα tue: Τρίτη @@ -4837,6 +4843,7 @@ action: am: πμ pm: μμ en: # English + bytes_per_char: 1 weekdays: mon: Monday tue: Tuesday @@ -4912,6 +4919,7 @@ action: am: AM pm: PM es: # Spanish + bytes_per_char: 1 weekdays: mon: Lunes tue: Martes @@ -4987,6 +4995,7 @@ action: am: a.m. pm: p.m. et: # Estonian + bytes_per_char: 1 weekdays: mon: Esmaspäev tue: Teisipäev @@ -5062,6 +5071,7 @@ action: am: e.l. pm: p.l. fi: # Finnish + bytes_per_char: 1 weekdays: mon: maanantai tue: tiistai @@ -5137,6 +5147,7 @@ action: am: aamupäivä pm: iltapäivä fr: # French + bytes_per_char: 1 weekdays: mon: Lundi tue: Mardi @@ -5212,6 +5223,7 @@ action: am: AM pm: PM he: # Hebrew + bytes_per_char: 2 weekdays: mon: ינש tue: ישילש @@ -5287,6 +5299,7 @@ action: am: צ"הנפל pm: צ"החא hr: # Croatian + bytes_per_char: 1 weekdays: mon: Ponedjeljak tue: Utorak @@ -5362,6 +5375,7 @@ action: am: AM pm: PM hu: # Hungarian + bytes_per_char: 1 weekdays: mon: Hétfő tue: Kedd @@ -5437,6 +5451,7 @@ action: am: DE pm: DU id: # Indonesian + bytes_per_char: 1 weekdays: mon: Senin tue: Selasa @@ -5512,6 +5527,7 @@ action: am: AM pm: PM it: # Italian + bytes_per_char: 1 weekdays: mon: Lunedì tue: Martedì @@ -5587,6 +5603,7 @@ action: am: AM pm: PM ja: # Japanese + bytes_per_char: 3 weekdays: mon: 月曜日 tue: 火曜日 @@ -5662,6 +5679,7 @@ action: am: 午前 pm: 午後 ko: # Korean + bytes_per_char: 3 weekdays: mon: 월요일 tue: 화요일 @@ -5737,6 +5755,7 @@ action: am: 오전 pm: 오후 lt: # Lithuanian + bytes_per_char: 1 weekdays: mon: Pirmadienis tue: Antradienis @@ -5812,6 +5831,7 @@ action: am: AM pm: PM lv: # Latvian + bytes_per_char: 1 weekdays: mon: Pirmdiena tue: Otrdiena @@ -5887,6 +5907,7 @@ action: am: AM pm: PM nb: # Norwegian Bokmål + bytes_per_char: 1 weekdays: mon: Mandag tue: Tirsdag @@ -5962,6 +5983,7 @@ action: am: AM pm: PM nl: # Dutch + bytes_per_char: 1 weekdays: mon: Maandag tue: Dinsdag @@ -6037,6 +6059,7 @@ action: am: AM pm: PM pl: # Polish + bytes_per_char: 1 weekdays: mon: Poniedziałek tue: Wtorek @@ -6112,6 +6135,7 @@ action: am: AM pm: PM pt: # Portuguese + bytes_per_char: 1 weekdays: mon: Segunda-feira tue: Terça-feira @@ -6187,6 +6211,7 @@ action: am: AM pm: PM ro: # Romanian + bytes_per_char: 1 weekdays: mon: Luni tue: Marți @@ -6262,6 +6287,7 @@ action: am: AM pm: PM ru: # Russian + bytes_per_char: 2 weekdays: mon: Понедельник tue: Вторник @@ -6337,6 +6363,7 @@ action: am: ДП pm: ПП sk: # Slovak + bytes_per_char: 1 weekdays: mon: Pondelok tue: Utorok @@ -6412,6 +6439,7 @@ action: am: AM pm: PM sl: # Slovenian + bytes_per_char: 1 weekdays: mon: Ponedeljek tue: Torek @@ -6487,6 +6515,7 @@ action: am: dop. pm: pop. sv: # Swedish + bytes_per_char: 1 weekdays: mon: Måndag tue: Tisdag @@ -6562,6 +6591,7 @@ action: am: FM pm: EM tr: # Turkish + bytes_per_char: 1 weekdays: mon: Pazartesi tue: Salı @@ -6637,6 +6667,7 @@ action: am: ÖÖ pm: ÖS uk: # Ukrainian + bytes_per_char: 2 weekdays: mon: Понеділок tue: Вівторок @@ -6712,6 +6743,7 @@ action: am: ДП pm: ПП zh-tw: # Traditional Chinese + bytes_per_char: 3 weekdays: mon: 星期一 tue: 星期二 @@ -7918,6 +7950,7 @@ action: screensaver_time_font: !input screensaver_display_time_font_size screensaver_time_color: !input screensaver_display_time_font_color decimal_separator: !input decimal_separator + # bytes_per_char: '{{ mui[language].bytes_per_char }}' # To do: Enable this on new protocol continue_on_error: true # Disable empty buttons pages