From 4cdd80550f4b3f7acf8148965d2ce34857916275 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 16 Jan 2024 00:18:23 +0100 Subject: [PATCH] Add log to climate page constructor To help troubleshooting: - #1627 - #1613 --- .../esphome/nspanel_esphome_addon_climate_base.yaml | 12 +++++++----- nspanel_blueprint.yaml | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml index 8938c77..46768a6 100644 --- a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml +++ b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml @@ -105,18 +105,20 @@ script: - id: !extend page_climate then: - lambda: |- + static const char *const TAG = "addon_climate_base.script.page_climate"; + ESP_LOGD(TAG, "Climate page constructor:"); + ESP_LOGD(TAG, " Current page: %s", current_page->state.c_str()); + ESP_LOGD(TAG, " Detailed entity: %s", detailed_entity->state.c_str()); + ESP_LOGD(TAG, " Embedded climate: %s", id(is_addon_climate_visible) ? "True" : "False"); if (current_page->state == "climate" and id(is_addon_climate_visible)) { + ESP_LOGD(TAG, " Add-on mode: %s", (${addon_climate_dual}) ? "Dual" : ((${addon_climate_heat}) ? "Heat" : ((${addon_climate_cool}) ? "Cool" : "Unknown"))); + ESP_LOGV(TAG, " Page label: %s", id(addon_climate_friendly_name).c_str()); disp1->set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str()); float temp_step = ${temp_step}; float temp_offset = ${temp_min}; float temp_max = ${temp_max}; float total_steps = (temp_max-temp_offset)/temp_step; - uint supported_hvac_modes = 0; - if (${addon_climate_dual}) - supported_hvac_modes = 3; - else - supported_hvac_modes = supported_hvac_modes + ((${addon_climate_heat}) ? 1 : 0) + ((${addon_climate_cool}) ? 2 : 0); set_climate->execute ( thermostat_embedded->current_temperature, // current_temp diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index b2f2e90..0b945a9 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -8026,7 +8026,7 @@ action: - *hide-home_page-climate_chip ###### Status / Chips bar ###### - - &variables-home_page_status_bar + - &variables_home_page_status_bar variables: home_page_status_bar: - entity: !input 'chip01' @@ -8072,7 +8072,7 @@ action: | list }} sequence: - - &display-home_page_status_bar + - &display_home_page_status_bar if: '{{ repeat.item.entity is defined and repeat.item.entity is string and repeat.item.entity | length > 0 }}' then: - variables: @@ -10502,7 +10502,7 @@ action: - chip06_state - chip07_state sequence: - - *variables-home_page_status_bar + - *variables_home_page_status_bar - repeat: for_each: > {{ @@ -10512,7 +10512,7 @@ action: | list }} sequence: - - *display-home_page_status_bar + - *display_home_page_status_bar ##### HW BUTTON - state ##### - alias: Hardware button - State