From 5fbc33001a591a45e268cfb2d7bac9ba6dc1da84 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 19 Jun 2026 01:58:34 -0600 Subject: [PATCH] Revert "dashboard: compute temp alert from contract threshold" This reverts commit 3c438bd4acc98968603b6657ef0e5037ff38048c. --- firmware/esp32-s3-dashboard/dashboard_config.h | 2 +- .../esp32-s3-dashboard/esp32-s3-dashboard.ino | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/firmware/esp32-s3-dashboard/dashboard_config.h b/firmware/esp32-s3-dashboard/dashboard_config.h index 26c6a34..defb646 100644 --- a/firmware/esp32-s3-dashboard/dashboard_config.h +++ b/firmware/esp32-s3-dashboard/dashboard_config.h @@ -1,6 +1,6 @@ #pragma once -static const char *DASHBOARD_VERSION = "0.1.118-temp-alert-local-threshold"; +static const char *DASHBOARD_VERSION = "0.1.117-temp-alert-contract-logic"; // Update these if your Cargo ESP AP credentials are different. //static const char *CARGO_WIFI_SSID = "OverlandController"; diff --git a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino index 108f320..ce71b45 100644 --- a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino +++ b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino @@ -1464,14 +1464,13 @@ static void parse_status_json(const String &body) } float temp_f = (float)(temp["temperature_f"] | 0.0); - bool high_alert = temp["high_alert"] | false; - - bool high_alert_enabled = temp["high_alert_enabled"] | false; - float high_alert_f = (float)(temp["high_alert_f"] | 9999.0); - - if (high_alert_enabled && temp_f >= high_alert_f) { - high_alert = true; - } + bool high_alert = + (temp["high_alert"] | false) || + ( + (temp["high_alert_enabled"] | false) && + !temp["high_alert_f"].isNull() && + temp_f > (float)(temp["high_alert_f"] | 9999.0) + ); if (weather) { outside_status = "OUT ";