Add log to climate page constructor

To help troubleshooting:
- #1627
- #1613
This commit is contained in:
Edward Firmo
2024-01-16 00:18:23 +01:00
parent 17c200da53
commit 4cdd80550f
2 changed files with 11 additions and 9 deletions

View File

@@ -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