Support to Fahrenheit with esp-idf

This commit is contained in:
Edward Firmo
2023-12-18 13:21:19 +01:00
parent a1e488c72f
commit b086ccc16d
2 changed files with 28 additions and 27 deletions

View File

@@ -1257,7 +1257,8 @@ sensor:
reference_resistance: 10kOhm reference_resistance: 10kOhm
filters: filters:
- lambda: |- - lambda: |-
if ("${temp_units}" == "°F" or "${temp_units}" == "F" or "${temp_units}" == "°f" or "${temp_units}" == "f") std::string temp_unit = "${temp_units}";
if (temp_unit == "°F" or temp_unit == "F" or temp_unit == "°f" or temp_unit == "f")
return (x * (9.0/5.0)) + 32.0 + temperature_correction->state; return (x * (9.0/5.0)) + 32.0 + temperature_correction->state;
else else
return x + temperature_correction->state; return x + temperature_correction->state;