Clean-up logs
To reduce RAM requirements
This commit is contained in:
@@ -51,11 +51,8 @@ climate:
|
|||||||
internal: false
|
internal: false
|
||||||
on_state:
|
on_state:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
static const char *const TAG = "addon_climate_base.climate.thermostat_embedded.on_state";
|
|
||||||
ESP_LOGD(TAG, "Starting");
|
|
||||||
page_climate->execute();
|
page_climate->execute();
|
||||||
page_home->execute();
|
page_home->execute();
|
||||||
ESP_LOGD(TAG, "Finished");
|
|
||||||
|
|
||||||
globals:
|
globals:
|
||||||
##### Is embedded thermostat visible on climate page? #####
|
##### Is embedded thermostat visible on climate page? #####
|
||||||
@@ -83,7 +80,6 @@ script:
|
|||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
if (embedded and !id(is_uploading_tft)) {
|
if (embedded and !id(is_uploading_tft)) {
|
||||||
static const char *const TAG = "addon_climate_base.script.change_climate_state";
|
|
||||||
auto FahrenheitToCelsius = [](float fahrenheit) -> float {
|
auto FahrenheitToCelsius = [](float fahrenheit) -> float {
|
||||||
return (fahrenheit - 32.0) * 5.0 / 9.0;
|
return (fahrenheit - 32.0) * 5.0 / 9.0;
|
||||||
};
|
};
|
||||||
@@ -97,26 +93,17 @@ script:
|
|||||||
if (key == "temperature") {
|
if (key == "temperature") {
|
||||||
temperature = stof(value) / 10;
|
temperature = stof(value) / 10;
|
||||||
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
||||||
ESP_LOGD(TAG, "set_target_temperature(%f)", temperature);
|
|
||||||
call.set_target_temperature(temperature);
|
call.set_target_temperature(temperature);
|
||||||
} else if (key == "target_temp_high") {
|
} else if (key == "target_temp_high") {
|
||||||
temperature = stof(value) / 10;
|
temperature = stof(value) / 10;
|
||||||
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
||||||
ESP_LOGD(TAG, "set_target_temperature_high(%f)", temperature);
|
|
||||||
call.set_target_temperature_high(temperature);
|
call.set_target_temperature_high(temperature);
|
||||||
} else if (key == "target_temp_low") {
|
} else if (key == "target_temp_low") {
|
||||||
temperature = stof(value) / 10;
|
temperature = stof(value) / 10;
|
||||||
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
if (temp_unit_fahrenheit) temperature = FahrenheitToCelsius(temperature);
|
||||||
ESP_LOGD(TAG, "set_target_temperature_low(%f)", temperature);
|
|
||||||
call.set_target_temperature_low(temperature);
|
call.set_target_temperature_low(temperature);
|
||||||
} else if (key == "hvac_mode") {
|
} else if (key == "hvac_mode") {
|
||||||
ESP_LOGD(TAG, "hvac_mode(%s)", value.c_str());
|
|
||||||
call.set_mode(value);
|
call.set_mode(value);
|
||||||
} else {
|
|
||||||
ESP_LOGE(TAG, "Invalid call:");
|
|
||||||
ESP_LOGE(TAG, " Embedded: %s", YESNO(embedded));
|
|
||||||
ESP_LOGE(TAG, " Key: %s", key.c_str());
|
|
||||||
ESP_LOGE(TAG, " Value: %s", value.c_str());
|
|
||||||
}
|
}
|
||||||
call.perform();
|
call.perform();
|
||||||
}
|
}
|
||||||
@@ -131,7 +118,6 @@ script:
|
|||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(is_addon_climate_visible) = (current_page->state == "climate" and detailed_entity->state == "embedded_climate");
|
id(is_addon_climate_visible) = (current_page->state == "climate" and detailed_entity->state == "embedded_climate");
|
||||||
if (id(is_addon_climate_visible) and !id(is_uploading_tft)) {
|
if (id(is_addon_climate_visible) and !id(is_uploading_tft)) {
|
||||||
static const char *const TAG = "addon_climate_base.script.page_climate";
|
|
||||||
auto CelsiusToFahrenheit = [](float celsius) -> float {
|
auto CelsiusToFahrenheit = [](float celsius) -> float {
|
||||||
return (celsius * 9 / 5) + 32;
|
return (celsius * 9 / 5) + 32;
|
||||||
};
|
};
|
||||||
@@ -139,9 +125,6 @@ script:
|
|||||||
bool temp_unit_fahrenheit = (temp_units == "°F" || temp_units == "F" || temp_units == "°f" || temp_units == "f");
|
bool temp_unit_fahrenheit = (temp_units == "°F" || temp_units == "F" || temp_units == "°f" || temp_units == "f");
|
||||||
ClimateTraits traits = thermostat_embedded->get_traits();
|
ClimateTraits traits = thermostat_embedded->get_traits();
|
||||||
|
|
||||||
ESP_LOGV(TAG, "Climate page constructor:");
|
|
||||||
ESP_LOGV(TAG, " Add-on mode: %s", (${addon_climate_dual}) ? "Dual" : ((${addon_climate_heat}) ? "Heat" : ((${addon_climate_cool}) ? "Cool" : "Unknown")));
|
|
||||||
ESP_LOGV(TAG, " Temp. units: %s", temp_unit_fahrenheit ? "Fahrenheit" : "Celsius");
|
|
||||||
disp1->set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str());
|
disp1->set_component_text_printf("page_label", id(addon_climate_friendly_name).c_str());
|
||||||
float temp_step = traits.get_visual_target_temperature_step();
|
float temp_step = traits.get_visual_target_temperature_step();
|
||||||
float temp_offset = traits.get_visual_min_temperature();
|
float temp_offset = traits.get_visual_min_temperature();
|
||||||
|
|||||||
@@ -50,9 +50,6 @@ api:
|
|||||||
url: string
|
url: string
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
static const char *const TAG = "addon_upload_tft.api.services.upload_tft";
|
|
||||||
ESP_LOGD(TAG, "Custom TFT file upload requested");
|
|
||||||
ESP_LOGD(TAG, " URL: %s", url.c_str());
|
|
||||||
std::string clean_url = url;
|
std::string clean_url = url;
|
||||||
// Convert to lowercase
|
// Convert to lowercase
|
||||||
std::transform(clean_url.begin(), clean_url.end(), clean_url.begin(),
|
std::transform(clean_url.begin(), clean_url.end(), clean_url.begin(),
|
||||||
|
|||||||
Reference in New Issue
Block a user