From 1fb11564d659e5c63f9802ae52c24ad8de4b525f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:21:54 +0100 Subject: [PATCH] Fix test for temp_units Solves #1834 --- esphome/nspanel_esphome_core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 3982c5d..47f0cc2 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -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 {