@@ -1867,7 +1867,7 @@ script:
|
|||||||
- lambda: |-
|
- lambda: |-
|
||||||
float unit_based_temperature = id(temp_nspanel).state;
|
float unit_based_temperature = id(temp_nspanel).state;
|
||||||
char buffer[15]; // Buffer for formatted temperature string
|
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
|
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
|
snprintf(buffer, sizeof(buffer), "%.0f°F", unit_based_temperature); // Fahrenheit with no decimal
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user