Do not convert Celsius to Fahrenheit when displaying embedded temperature

Solves #1640
This commit is contained in:
Edward Firmo
2024-01-16 11:17:15 +01:00
parent 759e49bdf2
commit 9a501c45a2

View File

@@ -306,7 +306,7 @@ api:
embedded_climate: bool
embedded_climate_friendly_name: string
embedded_indoor_temperature: bool
temperature_unit_is_fahrenheit: bool
temperature_unit_is_fahrenheit: bool # Deprecated
mui_please_confirm: string
mui_unavailable: string
screensaver_time: bool
@@ -318,7 +318,6 @@ api:
embedded_climate: !lambda "return embedded_climate;"
embedded_climate_friendly_name: !lambda "return embedded_climate_friendly_name;"
embedded_indoor_temperature: !lambda "return embedded_indoor_temperature;"
temperature_unit_is_fahrenheit: !lambda "return temperature_unit_is_fahrenheit;"
mui_please_confirm: !lambda "return mui_please_confirm;"
mui_unavailable: !lambda "return mui_unavailable;"
screensaver_time: !lambda "return screensaver_time;"
@@ -834,10 +833,6 @@ globals:
type: bool
restore_value: true
initial_value: 'false'
- id: temp_unit_fahrenheit
type: bool
restore_value: true
initial_value: 'false'
##### Date/time formats #####
- id: home_date_color
@@ -1758,19 +1753,10 @@ script:
- id: display_embedded_temp
mode: restart
then:
- if:
condition:
- or:
- lambda: return id(embedded_indoor_temp);
- not:
- api.connected:
- not:
- wifi.connected:
then:
- lambda: |-
if (id(temp_unit_fahrenheit)) disp1->set_component_text_printf("home.current_temp", "%.0f°F", ((temp_nspanel->state * 9.0 / 5.0) + 32.0)); // °F = (°C × 9/5) + 32
else disp1->set_component_text_printf("home.current_temp", "%.1f°C", temp_nspanel->state);
if (id(embedded_indoor_temp) or (!wifi_component->is_connected()) or (!api_server->is_connected()))
disp1->set_component_text_printf("home.current_temp", "%.1f${temp_units}", temp_nspanel->state);
- id: display_wrapped_text
mode: queued
@@ -1832,7 +1818,6 @@ script:
embedded_climate: bool
embedded_climate_friendly_name: string
embedded_indoor_temperature: bool
temperature_unit_is_fahrenheit: bool
mui_please_confirm: string
mui_unavailable: string
screensaver_time: bool
@@ -1852,7 +1837,6 @@ script:
// Indoor temperature
ESP_LOGV(TAG, "Set indoor temperature");
id(embedded_indoor_temp) = embedded_indoor_temperature;
id(temp_unit_fahrenheit) = temperature_unit_is_fahrenheit;
display_embedded_temp->execute();
// MUI strings