Fix test for temp_units

Solves #1834
This commit is contained in:
Edward Firmo
2024-03-13 09:21:54 +01:00
parent fc2bd3d40b
commit 1fb11564d6

View File

@@ -1867,7 +1867,7 @@ script:
- lambda: |-
float unit_based_temperature = id(temp_nspanel).state;
char buffer[15]; // Buffer for formatted temperature string
if ("${temp_units}"[0] == 'F' || "${temp_units}"[0] == 'f') {
if ("${temp_units}"[0] == 'F' || "${temp_units}"[0] == 'f' || "${temp_units}"[1] == 'F' || "${temp_units}"[1] == 'f') {
unit_based_temperature = (unit_based_temperature * 9.0 / 5.0) + 32; // Convert to Fahrenheit if necessary
snprintf(buffer, sizeof(buffer), "%.0f°F", unit_based_temperature); // Fahrenheit with no decimal
} else {