fix: display BME280 ambient temperature in Fahrenheit, not Celsius
sensors.yaml formatted the raw BME280 reading directly with no unit conversion, inconsistent with the dial setpoints and weather widget, which are already Fahrenheit. Converts at the only point this sensor's value reaches the UI (shared by every display variant); climate.yaml's internal Celsius values are untouched since ESPHome's climate component always operates in Celsius regardless of display unit.
This commit is contained in:
parent
91f47be62a
commit
a0734891ad
3 changed files with 12 additions and 8 deletions
|
|
@ -222,7 +222,7 @@ lvgl:
|
|||
text_font: montserrat_20
|
||||
- label:
|
||||
id: home_temp_label
|
||||
text: "-- °C"
|
||||
text: "-- °F"
|
||||
text_font: montserrat_48
|
||||
- button:
|
||||
align: bottom_left
|
||||
|
|
@ -334,7 +334,7 @@ lvgl:
|
|||
widgets:
|
||||
- label:
|
||||
id: sensors_temp_label
|
||||
text: "Temperature: -- °C"
|
||||
text: "Temperature: -- °F"
|
||||
text_font: montserrat_28
|
||||
- label:
|
||||
id: sensors_humidity_label
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ lvgl:
|
|||
widgets:
|
||||
- label:
|
||||
id: home_temp_label
|
||||
text: "-- °C"
|
||||
text: "-- °F"
|
||||
text_font: montserrat_48
|
||||
- label:
|
||||
id: home_mode_label
|
||||
|
|
@ -84,7 +84,7 @@ lvgl:
|
|||
widgets:
|
||||
- label:
|
||||
id: sensors_temp_label
|
||||
text: "Temperature: -- °C"
|
||||
text: "Temperature: -- °F"
|
||||
text_font: montserrat_28
|
||||
- label:
|
||||
id: sensors_humidity_label
|
||||
|
|
|
|||
|
|
@ -8,16 +8,20 @@ sensor:
|
|||
id: bme280_temperature
|
||||
on_value:
|
||||
then:
|
||||
# BME280 reports Celsius natively; converted to Fahrenheit here (the only place
|
||||
# this sensor's value reaches the UI) to match the dial setpoints and weather
|
||||
# widget, which are already Fahrenheit. Not a dynamic HA unit-system sync — ESPHome
|
||||
# has no standard entity exposing that setting — just a fixed display convention.
|
||||
- lvgl.label.update:
|
||||
id: home_temp_label
|
||||
text:
|
||||
format: "%.1f °C"
|
||||
args: ["x"]
|
||||
format: "%.1f °F"
|
||||
args: ["x * 9.0f / 5.0f + 32.0f"]
|
||||
- lvgl.label.update:
|
||||
id: sensors_temp_label
|
||||
text:
|
||||
format: "Temperature: %.1f °C"
|
||||
args: ["x"]
|
||||
format: "Temperature: %.1f °F"
|
||||
args: ["x * 9.0f / 5.0f + 32.0f"]
|
||||
humidity:
|
||||
name: "Ambient Humidity"
|
||||
id: bme280_humidity
|
||||
|
|
|
|||
Loading…
Reference in a new issue