Do not convert Celsius to Fahrenheit when displaying embedded temperature
Solves #1640
This commit is contained in:
@@ -306,7 +306,7 @@ api:
|
|||||||
embedded_climate: bool
|
embedded_climate: bool
|
||||||
embedded_climate_friendly_name: string
|
embedded_climate_friendly_name: string
|
||||||
embedded_indoor_temperature: bool
|
embedded_indoor_temperature: bool
|
||||||
temperature_unit_is_fahrenheit: bool
|
temperature_unit_is_fahrenheit: bool # Deprecated
|
||||||
mui_please_confirm: string
|
mui_please_confirm: string
|
||||||
mui_unavailable: string
|
mui_unavailable: string
|
||||||
screensaver_time: bool
|
screensaver_time: bool
|
||||||
@@ -318,7 +318,6 @@ api:
|
|||||||
embedded_climate: !lambda "return embedded_climate;"
|
embedded_climate: !lambda "return embedded_climate;"
|
||||||
embedded_climate_friendly_name: !lambda "return embedded_climate_friendly_name;"
|
embedded_climate_friendly_name: !lambda "return embedded_climate_friendly_name;"
|
||||||
embedded_indoor_temperature: !lambda "return embedded_indoor_temperature;"
|
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_please_confirm: !lambda "return mui_please_confirm;"
|
||||||
mui_unavailable: !lambda "return mui_unavailable;"
|
mui_unavailable: !lambda "return mui_unavailable;"
|
||||||
screensaver_time: !lambda "return screensaver_time;"
|
screensaver_time: !lambda "return screensaver_time;"
|
||||||
@@ -834,10 +833,6 @@ globals:
|
|||||||
type: bool
|
type: bool
|
||||||
restore_value: true
|
restore_value: true
|
||||||
initial_value: 'false'
|
initial_value: 'false'
|
||||||
- id: temp_unit_fahrenheit
|
|
||||||
type: bool
|
|
||||||
restore_value: true
|
|
||||||
initial_value: 'false'
|
|
||||||
|
|
||||||
##### Date/time formats #####
|
##### Date/time formats #####
|
||||||
- id: home_date_color
|
- id: home_date_color
|
||||||
@@ -1759,18 +1754,9 @@ script:
|
|||||||
- id: display_embedded_temp
|
- id: display_embedded_temp
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
- if:
|
- lambda: |-
|
||||||
condition:
|
if (id(embedded_indoor_temp) or (!wifi_component->is_connected()) or (!api_server->is_connected()))
|
||||||
- or:
|
disp1->set_component_text_printf("home.current_temp", "%.1f${temp_units}", temp_nspanel->state);
|
||||||
- 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);
|
|
||||||
|
|
||||||
- id: display_wrapped_text
|
- id: display_wrapped_text
|
||||||
mode: queued
|
mode: queued
|
||||||
@@ -1832,7 +1818,6 @@ script:
|
|||||||
embedded_climate: bool
|
embedded_climate: bool
|
||||||
embedded_climate_friendly_name: string
|
embedded_climate_friendly_name: string
|
||||||
embedded_indoor_temperature: bool
|
embedded_indoor_temperature: bool
|
||||||
temperature_unit_is_fahrenheit: bool
|
|
||||||
mui_please_confirm: string
|
mui_please_confirm: string
|
||||||
mui_unavailable: string
|
mui_unavailable: string
|
||||||
screensaver_time: bool
|
screensaver_time: bool
|
||||||
@@ -1852,7 +1837,6 @@ script:
|
|||||||
// Indoor temperature
|
// Indoor temperature
|
||||||
ESP_LOGV(TAG, "Set indoor temperature");
|
ESP_LOGV(TAG, "Set indoor temperature");
|
||||||
id(embedded_indoor_temp) = embedded_indoor_temperature;
|
id(embedded_indoor_temp) = embedded_indoor_temperature;
|
||||||
id(temp_unit_fahrenheit) = temperature_unit_is_fahrenheit;
|
|
||||||
display_embedded_temp->execute();
|
display_embedded_temp->execute();
|
||||||
|
|
||||||
// MUI strings
|
// MUI strings
|
||||||
|
|||||||
Reference in New Issue
Block a user