Do not update climate entity when page home is refreshed

Solves #1530
This commit is contained in:
Edward Firmo
2024-01-04 15:33:06 +01:00
parent fe124dfe9c
commit 77a2ab7c46
5 changed files with 110 additions and 57 deletions

View File

@@ -47,7 +47,7 @@ climate:
internal: false
on_state:
- lambda: |-
static const char *const TAG = "climate.thermostat_embedded.on_state";
static const char *const TAG = "addon_climate_base.climate.thermostat_embedded.on_state";
ESP_LOGD(TAG, "Starting");
page_climate->execute();
page_home->execute();
@@ -129,12 +129,12 @@ script:
);
// Update target temp icon
update_climate_icon->execute("climate.target_icon", int(thermostat_embedded->action), int(thermostat_embedded->mode));
update_climate_icon->execute("target_icon", int(thermostat_embedded->action), int(thermostat_embedded->mode));
// Update buttons bar
// Hide not supported hotspots
disp1->hide_component("button01");
if (${addon_climate_dual}) disp1->hide_component("button02");
if (${addon_climate_dual}) disp1->show_component("button02"); else disp1->hide_component("button02");
if (${addon_climate_heat} or ${addon_climate_dual}) disp1->show_component("button03"); else disp1->hide_component("button03"); //Heat
if (${addon_climate_cool} or ${addon_climate_dual}) disp1->show_component("button04"); else disp1->hide_component("button04"); //Cool
disp1->hide_component("button05");
@@ -158,9 +158,6 @@ script:
- id: !extend page_home
then:
- lambda: |-
// Update home.climate_entity variable
detailed_entity->publish_state((id(is_embedded_thermostat)) ? "embedded_climate" : "");
disp1->set_component_value("climate.embedded", (id(is_embedded_thermostat)) ? 1 : 0);
// Update chips
if (id(is_embedded_thermostat))
id(update_climate_icon).execute("home.icon_top_03", int(thermostat_embedded->action), int(thermostat_embedded->mode));