diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 19310ab..8827f5c 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -76,6 +76,7 @@ You can add it back as a [customization](https://github.com/Blackymas/NSPanel_HA 2. Hardware restarts with button hold for 15s 3. Support to `esp-idf` framework 4. Support to 921600 bps +5. Font size for chips   ## Details of noteworthy changes @@ -103,8 +104,22 @@ Please look at [customizations docs in the Wiki](https://github.com/Blackymas/NS ### 4. Support to 921600 bps Until this point, the communication between ESPHome and the Nextion display is at 115200 bps. This is not changing for now, but we are preparing to change this in the near future to a higer rate of 921600 bps, which is 8 times higher than the one used currently. After installing the latest TFT v4.1, you will be able to [change the speed as a customization](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Customization#change-uarts-baud-rate) and your system will switch to the higher transfer rate after the next boot. +
In most of the cases, you are not going to see any diference related tho this change, but it will reduce significantly the time to upload a TFT file. -In most of the cases, you are not going to see any diference related tho this change, but it will reduce significantly the time to upload a TFT file. +  +### 5. Font size for chips +We ran a poll, the maiority select one option, but we respect the minority and... we supported both options. :smiley: +
Now you can have your chips a bit bigger, making it easier to see from the distance: + +| 24px | 32px | +| :--: | :--: | +| As before | New option | +| ![EU font 8](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/dfb79856-8456-443c-b4de-a955be8e4561) | ![EU font 9](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/268ec945-94dc-4f17-be94-8abd691ef2ed) | +| ![US font 8](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/a9eb3578-901a-444f-9d52-3909f2aa4f34) | ![US font 9](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/e46bac5e-8a84-4cfe-a01d-159042828350) | + + +If you wanna try the new option, just go to your blueprint setting and select the font size: +![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/83e64dfa-b2cf-4186-af2a-6f89c96e9044)   ## Next topics we are currently working on diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 8173203..5097e25 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -324,6 +324,21 @@ blueprint: default: ' ' selector: *placeholder-selector ##### PLACEHOLDER ###################################################################### + chip_font_size: + name: Chip font size + description: > + *HOME page* + + *The size of the icons shown on the chips* + default: '7' + selector: + select: + multiple: false + options: + - label: 24px + value: '7' + - label: 32px + value: '8' chip01: name: Chip 01 - ENTITY (Optional) description: > @@ -6553,6 +6568,7 @@ action: - &variables-home_buttons variables: + chip_font_size: !input chip_font_size bt_notific: icon: !input 'home_button04_icon' #E1ED color_normal: !input 'home_button04_icon_color01' @@ -6593,6 +6609,7 @@ action: if is_number(display.time.color_rgb) else ((display.time.color_rgb[0] //(2**3)) *(2**11))+((display.time.color_rgb[1] //(2**2)) *(2**5))+(display.time.color_rgb[2] //(2**3)) }} + chip_font_size: '{{ chip_font_size }}' notification_icon: > {{ all_icons[bt_notific.icon.split(":")[1]] | default(bt_notific.icon diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index 5a0c448..78de8a1 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -241,12 +241,14 @@ api: ESP_LOGV(TAG, "Setup relays"); relay1_local->publish_state(relay1_local_control); relay2_local->publish_state(relay2_local_control); - id(home_relay1_icon) = relay1_icon.c_str(); - id(home_relay2_icon) = relay2_icon.c_str(); id(relay_1_fallback) = relay1_fallback; id(relay_2_fallback) = relay2_fallback; - disp1->set_component_font_color("home.icon_top_01", id(home_relay1_icon_color)); - disp1->set_component_font_color("home.icon_top_02", id(home_relay2_icon_color)); + disp1->set_component_font_color("home.icon_top_01", relay1_icon_color); + disp1->set_component_font_color("home.icon_top_02", relay2_icon_color); + disp1->set_component_text_printf("home.icon_top_01", "%s", relay1_icon.c_str()); + disp1->set_component_text_printf("home.icon_top_02", "%s", relay2_icon.c_str()); + id(home_relay1_icon) = relay1_icon.c_str(); + id(home_relay2_icon) = relay2_icon.c_str(); id(home_relay1_icon_color) = relay1_icon_color; id(home_relay2_icon_color) = relay2_icon_color; @@ -517,6 +519,7 @@ api: date_color: int time_format: string time_color: int + chip_font_size: int notification_icon: string notification_icon_color_normal: int[] notification_icon_color_unread: int[] @@ -542,6 +545,14 @@ api: id(home_date_color) = date_color; id(home_time_color) = time_color; + // Chips icon size + ESP_LOGV(TAG, "Chips size"); + for (int i = 1; i <= 10; ++i) { + disp1->send_command_printf("home.icon_top_%02d.font=%i", i, chip_font_size); + } + disp1->send_command_printf("home.wifi_icon.font=%i", chip_font_size); + id(home_chip_font_size) = chip_font_size; + // Notification button ESP_LOGV(TAG, "Set Notification button"); disp1->send_command_printf("is_notification=%i", (notification_text->state.empty() and notification_label->state.empty()) ? 0 : 1); @@ -803,6 +814,12 @@ globals: restore_value: true initial_value: '65535' + ##### Chips ##### + - id: home_chip_font_size + type: uint + restore_value: true + initial_value: '7' + ##### Relay icons ##### - id: home_relay1_icon type: std::string @@ -2482,8 +2499,14 @@ script: {"type", "boot"}, {"step", "nextion_init"} }); - id(home_relay1_icon) = "\uE3A5"; - id(home_relay1_icon) = "\uE3A8"; + // Chips icon size + ESP_LOGV(TAG, "Chips size"); + for (int i = 1; i <= 10; ++i) { + disp1->send_command_printf("home.icon_top_%02d.font=%i", i, id(home_chip_font_size)); + } + disp1->send_command_printf("home.wifi_icon.font=%i", id(home_chip_font_size)); + disp1->set_component_text_printf("home.icon_top_01", "%s", id(home_relay1_icon).c_str()); + disp1->set_component_text_printf("home.icon_top_02", "%s", id(home_relay2_icon).c_str()); timer_reset_all->execute("boot"); notification_clear->execute(); ESP_LOGD(TAG, "Boot sequence finished!"); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 5717858..5a750b4 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 40d37f5..fcf531b 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_us.HMI b/nspanel_us.HMI index a31cd5c..c83566f 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index ad26e3f..aa3c588 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index c21fe1b..0346106 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index d0d207c..66c0e11 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ