Clean up code
- Removed commented out lines - Removed temporary logs Getting prepared to release
This commit is contained in:
@@ -71,52 +71,33 @@ script:
|
||||
mode: restart
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.addon_climate_update_page_home", "Starting");
|
||||
// Update home.climate_entity variable
|
||||
ESP_LOGV("script.addon_climate_update_page_home", "Update home.climate_entity variable: %s", (id(is_embedded_thermostat)) ? "embedded_climate" : "");
|
||||
id(entity_id) = (id(is_embedded_thermostat)) ? "embedded_climate" : "";
|
||||
id(disp1).set_component_value("climate.embedded", (id(is_embedded_thermostat)) ? 1 : 0);
|
||||
// Update chips
|
||||
if (id(is_embedded_thermostat))
|
||||
{
|
||||
ESP_LOGV("script.addon_climate_update_page_home", "Update chips");
|
||||
id(update_climate_icon).execute("home.icon_top_03", int(id(thermostat_embedded).action), int(id(thermostat_embedded).mode));
|
||||
}
|
||||
ESP_LOGV("script.addon_climate_update_page_home", "Finished");
|
||||
id(update_climate_icon).execute("home.icon_top_03", int(id(thermostat_embedded).action), int(id(thermostat_embedded).mode));
|
||||
|
||||
- id: !extend addon_climate_service_call
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.addon_climate_service_call", "Starting");
|
||||
id(is_addon_climate_visible) = true;
|
||||
id(disp1).set_component_value("climate.embedded", 1);
|
||||
auto call = id(thermostat_embedded).make_call();
|
||||
if (key == "set_temperature")
|
||||
{
|
||||
call.set_target_temperature(stof(value) / 10);
|
||||
}
|
||||
call.set_target_temperature(stof(value) / 10);
|
||||
else if (key == "hvac_mode")
|
||||
{
|
||||
call.set_mode(value);
|
||||
}
|
||||
call.set_mode(value);
|
||||
call.perform();
|
||||
ESP_LOGV("script.addon_climate_service_call", "Finished");
|
||||
|
||||
- id: !extend addon_climate_set_climate
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.addon_climate_set_climate", "Starting");
|
||||
ESP_LOGV("script.addon_climate_set_climate", "embedded_climate: %i", (embedded_climate) ? 1 : 0);
|
||||
id(is_addon_climate_visible) = embedded_climate;
|
||||
ESP_LOGV("script.addon_climate_set_climate", "Finished");
|
||||
|
||||
- id: !extend addon_climate_update_page_climate
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "Starting");
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "nextion_init: %i", (id(nextion_init)) ? 1 : 0);
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "current_page: %s", id(current_page).state.c_str());
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "is_addon_climate_visible: %i", (id(is_addon_climate_visible)) ? 1 : 0);
|
||||
if (id(current_page).state == "climate" and id(is_addon_climate_visible))
|
||||
{
|
||||
id(disp1).set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str());
|
||||
@@ -136,11 +117,9 @@ script:
|
||||
);
|
||||
|
||||
// Update target temp icon
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "thermostat_embedded.action=%i", int(id(thermostat_embedded).action));
|
||||
id(update_climate_icon).execute("climate.target_icon", int(id(thermostat_embedded).action), int(id(thermostat_embedded).mode));
|
||||
|
||||
// Update buttons bar
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "Updating buttons bar");
|
||||
// Hide not supported hotspots
|
||||
id(disp1).hide_component("button01");
|
||||
id(disp1).hide_component("button02");
|
||||
@@ -158,15 +137,11 @@ script:
|
||||
id(disp1).set_component_font_color("climate.button06_icon", 6339);
|
||||
id(disp1).set_component_font_color("climate.button07_icon", (id(thermostat_embedded).mode==climate::CLIMATE_MODE_OFF) ? 10597 : 35921);
|
||||
}
|
||||
ESP_LOGV("script.addon_climate_update_page_climate", "Finished");
|
||||
|
||||
- id: !extend addon_climate_set_climate_friendly_name
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.addon_climate_set_climate_friendly_name", "Starting");
|
||||
ESP_LOGV("script.addon_climate_set_climate_friendly_name", "friendly_name: %s", friendly_name.c_str());
|
||||
id(addon_climate_friendly_name) = friendly_name;
|
||||
ESP_LOGV("script.addon_climate_set_climate_friendly_name", "Finished");
|
||||
|
||||
switch:
|
||||
##### PHYSICAL SWITCH 0 (Dummy) - Used when relay is not set #####
|
||||
|
||||
Reference in New Issue
Block a user