From 7480aab072eb5f3de835ec6005fd5a2de0c3e2bc Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:21:37 +0100 Subject: [PATCH] Rebuild calls to outdoor temperature updates Improves #1802 --- esphome/nspanel_esphome_core.yaml | 6 ++++++ nspanel_blueprint.yaml | 25 +++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 3744c09..13f5012 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -590,6 +590,7 @@ api: entities_pages: bool entities_pages_icon: string entities_pages_icon_color: int[] + outdoor_temp_font: int then: - lambda: |- if (not id(is_uploading_tft)) { @@ -609,6 +610,7 @@ api: ESP_LOGV(TAG, "entities_pages: %s", YESNO(entities_pages)); ESP_LOGV(TAG, "entities_pages_icon: %s", entities_pages_icon.c_str()); ESP_LOGV(TAG, "entities_pages_icon_color: %i", entities_pages_icon_color.size()); + ESP_LOGV(TAG, "outdoor_temp_font: %i", outdoor_temp_font); // Localization ESP_LOGV(TAG, "Load localization"); @@ -640,6 +642,10 @@ api: disp1->send_command_printf("home.bt_qrcode.font=%i", id(home_custom_buttons_font_id)); disp1->send_command_printf("home.bt_entities.font=%i", id(home_custom_buttons_font_id)); + // Outdoor temperature font size + ESP_LOGV(TAG, "Outdoor temperature font size"); + disp1->send_command_printf("home.outdoor_temp.font==%i", outdoor_temp_font); + // 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); diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index f4f5330..9d6a3e2 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -7050,6 +7050,10 @@ action: screensaver_display_time: !input screensaver_display_time screensaver_display_time_font_color: !input screensaver_display_time_font_color + - &variables_outdoor_temp + variables: + home_outdoor_temp_font: !input 'home_outdoor_temp_font' + - service: '{{ nspanel.service.init.page.home }}' data: date_color: '{{ display.date.color_rgb }}' @@ -7082,6 +7086,7 @@ action: else all_icons["format-list-bulleted-square"]) }} entities_pages_icon_color: '{{ bt_entities.color_rgb }}' + outdoor_temp_font: '{{ int(home_outdoor_temp_font) if is_number(home_outdoor_temp_font) else 4 }}' continue_on_error: true ##### NSPanel Left Button Name ##### @@ -7357,22 +7362,14 @@ action: then: - variables: outdoor_temp_color_rgb: !input 'home_outdoor_temp_label_color' - home_outdoor_temp_font: !input 'home_outdoor_temp_font' - ### LABEL Outdoor Temp Font Color ### - - service: '{{ nspanel.service.component.color }}' + - service: '{{ nspanel.service.value }}' data: id: home.outdoor_temp - color: '{{ outdoor_temp_color_rgb }}' - continue_on_error: true - ### LABEL Outdoor Temp Font ### - - service: '{{ nspanel.service.component.text }}' - data: - id: home.outdoor_temp - txt: '{{ outdoor_temp | round(1) ~ temperature_units }}' - continue_on_error: true - - service: '{{ nspanel.service.command }}' - data: - cmd: 'home.outdoor_temp.font={{ home_outdoor_temp_font if is_number(home_outdoor_temp_font) else "4" }}' + icon: "" + icon_color: [] + name: "" + value: '{{ outdoor_temp | round(1) ~ temperature_units }}' + value_color: '{{ outdoor_temp_color_rgb }}' continue_on_error: true - &refresh-page_home-indoor_temp