diff --git a/ReleaseNotes.md b/ReleaseNotes.md index d393768..8bc3d9b 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -68,6 +68,7 @@ in addition to that, the [reset pin in the bottom of your panel](docs/pics/eu_re 1. New default framework 2. Performance improvements 3. New API documentation +4. Selectable font size for screensaver time display ## Details of noteworthy changes diff --git a/dev/ui/fonts/ubuntu_time112.zi b/dev/ui/fonts/ubuntu_time112.zi new file mode 100644 index 0000000..a14424a Binary files /dev/null and b/dev/ui/fonts/ubuntu_time112.zi differ diff --git a/dev/ui/fonts/ubuntu_time128.zi b/dev/ui/fonts/ubuntu_time128.zi new file mode 100644 index 0000000..6629c8e Binary files /dev/null and b/dev/ui/fonts/ubuntu_time128.zi differ diff --git a/dev/ui/fonts/ubuntu_time192.zi b/dev/ui/fonts/ubuntu_time192.zi new file mode 100644 index 0000000..dddfd2d Binary files /dev/null and b/dev/ui/fonts/ubuntu_time192.zi differ diff --git a/docs/api.md b/docs/api.md index 1164951..73dbab4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -312,6 +312,7 @@ It configures ESPHome with settings that affect overall functionality and user i - `mui_please_confirm` (string): Localized (language based) message used for asking for confirmation in the UI. - `mui_unavailable` (string): Localized (language based) message used for indicating unavailability in the UI. - `screensaver_time` (bool): Enables or disables the screensaver time display. +- `screensaver_time_font` (int): Specifies the font id for the screensaver time display. - `screensaver_time_color` (int[]): Specifies the RGB color array for the screensaver time display. **Home Assistant Example:** @@ -325,6 +326,7 @@ data: mui_please_confirm: "Confirme, por favor." mui_unavailable: "Indisponível" screensaver_time: true + screensaver_time_font: 11 screensaver_time_color: [165, 42, 42] # Reddish-brown ``` > [!NOTE] diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 82b4db3..a53e3d4 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -526,6 +526,7 @@ api: mui_please_confirm: string mui_unavailable: string screensaver_time: bool + screensaver_time_font: int screensaver_time_color: int[] then: - script.execute: @@ -538,6 +539,7 @@ api: mui_please_confirm: !lambda "return mui_please_confirm;" mui_unavailable: !lambda "return mui_unavailable;" screensaver_time: !lambda "return screensaver_time;" + screensaver_time_font: !lambda "return screensaver_time_font;" screensaver_time_color: !lambda "return screensaver_time_color;" - script.wait: global_settings - lambda: |- @@ -1504,8 +1506,12 @@ globals: ##### Screensaver ##### - id: screensaver_display_time type: bool - restore_value: false + restore_value: true initial_value: 'false' + - id: screensaver_display_time_font + type: int + restore_value: true + initial_value: '6' - id: screensaver_display_time_color type: std::vector restore_value: false @@ -2513,6 +2519,7 @@ script: mui_please_confirm: string mui_unavailable: string screensaver_time: bool + screensaver_time_font: int screensaver_time_color: int32_t[] then: - lambda: |- @@ -2539,6 +2546,7 @@ script: // Screen saver page (sleep) ESP_LOGV(TAG, "Setup screensaver page"); id(screensaver_display_time) = screensaver_time; + id(screensaver_display_time_font) = screensaver_time_font; id(screensaver_display_time_color) = screensaver_time_color; page_screensaver->execute(); @@ -2916,8 +2924,9 @@ script: set_page_id->execute("back_page_id", wakeup_page_name->state.c_str()); // disp1->send_command_printf("back_page_id=%i", id(wakeup_page_id)); if (id(screensaver_display_time)) { - disp1->show_component("text"); + disp1->send_command_printf("screensaver.text.font=%i", id(screensaver_display_time_font)); set_component_color->execute("screensaver.text",id(screensaver_display_time_color)); + disp1->show_component("text"); refresh_datetime->execute(); } else { disp1->set_backlight_brightness(0.0f); diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index 52862ef..fdaec77 100644 Binary files a/hmi/nspanel_eu.HMI and b/hmi/nspanel_eu.HMI differ diff --git a/hmi/nspanel_eu.tft b/hmi/nspanel_eu.tft index c033c81..61271e9 100644 Binary files a/hmi/nspanel_eu.tft and b/hmi/nspanel_eu.tft differ diff --git a/hmi/nspanel_us.HMI b/hmi/nspanel_us.HMI index a640edb..e3d34a6 100644 Binary files a/hmi/nspanel_us.HMI and b/hmi/nspanel_us.HMI differ diff --git a/hmi/nspanel_us.tft b/hmi/nspanel_us.tft index 5981e4e..53d0f25 100644 Binary files a/hmi/nspanel_us.tft and b/hmi/nspanel_us.tft differ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index d6c6602..6355db7 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3145,6 +3145,26 @@ blueprint: default: false selector: boolean: + screensaver_display_time_font_size: + name: Screen saver - Display time font size + description: > + *SCREENSAVER page* + + *Font size to be used when displaying the time while sleeping (screensaver).* + + *ATTENTION!! Some fonts may be limited by unavailable language chars or space in the screen. + Please fall back to the default size if you have issues.* + default: '6' + selector: + select: + multiple: false + options: + - label: 72px (default) + value: '6' + - label: 112px + value: '11' + - label: 192px + value: '12' screensaver_display_time_font_color: name: Screen saver - Display time font color description: > @@ -7049,6 +7069,7 @@ action: - &variables-screensaver variables: screensaver_display_time: !input screensaver_display_time + screensaver_display_time_font_size: !input screensaver_display_time_font_size screensaver_display_time_font_color: !input screensaver_display_time_font_color - &variables_outdoor_temp @@ -7217,6 +7238,7 @@ action: mui_please_confirm: '{{ mui[language].please_confirm }}' mui_unavailable: '{{ mui[language].unavailable }}' screensaver_time: '{{ screensaver_display_time if screensaver_display_time is boolean else false }}' + screensaver_time_font: '{{ int(screensaver_display_time_font_size) }}' screensaver_time_color: '{{ screensaver_display_time_font_color if screensaver_display_time_font_color is sequence else [64, 64, 64] }}' continue_on_error: true @@ -7689,16 +7711,13 @@ action: - &variables_page_buttons variables: event_page: '{{ nspanel_event.page if nspanel_event is defined and nspanel_event.page is defined else page.current }}' - button_page_index: '{{ (event_page[-2:] | int(-1)) - 1 }}' - first_button: '{{ button_page_index * 8 }}' - last_button: '{{ first_button + 8 }}' button_pages_icon_size: !input button_pages_icon_size ##### BUTTON Page Labels ##### button_pages_labels: - - label: !input button_page01_label - - label: !input button_page02_label - - label: !input button_page03_label - - label: !input button_page04_label + buttonpage01: !input button_page01_label + buttonpage02: !input button_page02_label + buttonpage03: !input button_page03_label + buttonpage04: !input button_page04_label ##### BUTTONS Page - Buttons 1 - 32 ##### button_pages_buttons: - entity: !input 'entity01' @@ -7927,7 +7946,9 @@ action: component: button08 confirm_list: > {{ - button_pages_buttons[first_button:last_button] + button_pages_buttons + | selectattr("page", "defined") + | selectattr("page", "eq", event_page) | sort(attribute="component") | map(attribute="confirm") | list @@ -7941,15 +7962,15 @@ action: {% set ns.index = ns.index + 1 %} {% endfor %} {{ ns.decimal_value }} - - if: '{{ button_page_index >= 0 and button_page_index <= 3 }}' + - if: '{{ event_page in page.buttonpages }}' then: ##### Button page Label ##### - - if: '{{ button_pages_labels[button_page_index].label | length > 0 }}' + - if: '{{ button_pages_labels[event_page] | length > 0 }}' then: - service: '{{ nspanel.service.component.text }}' data: id: page_label - txt: '{{ button_pages_labels[button_page_index].label }}' + txt: '{{ button_pages_labels[event_page] }}' continue_on_error: true ###### Confirm buttons ###### @@ -7965,7 +7986,7 @@ action: {{ button_pages_buttons | selectattr("page", "defined") - | selectattr("page", "eq", page.current) + | selectattr("page", "eq", event_page) | selectattr("entity", "defined") | list }}