From 3e88a7a28af8e66f36ad4591bb557da34b7dcd26 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 19 Jun 2026 01:53:38 -0600 Subject: [PATCH] dashboard: use cargo temp alert contract fields --- firmware/esp32-s3-dashboard/dashboard_config.h | 2 +- .../esp32-s3-dashboard/esp32-s3-dashboard.ino | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/firmware/esp32-s3-dashboard/dashboard_config.h b/firmware/esp32-s3-dashboard/dashboard_config.h index e86184a..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.116-temp-alert-field-parsing"; +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 bd04219..ce71b45 100644 --- a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino +++ b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino @@ -1464,21 +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) || - (temp["alert"] | false) || - (temp["alarm"] | false) || - (temp["high_alarm"] | false) || - (temp["temp_high"] | false); - - if (!temp["high_threshold_f"].isNull()) { - high_alert = high_alert || temp_f >= (float)(temp["high_threshold_f"] | 9999.0); - } - - if (!temp["alarm_threshold_f"].isNull()) { - high_alert = high_alert || temp_f >= (float)(temp["alarm_threshold_f"] | 9999.0); - } + ( + (temp["high_alert_enabled"] | false) && + !temp["high_alert_f"].isNull() && + temp_f > (float)(temp["high_alert_f"] | 9999.0) + ); if (weather) { outside_status = "OUT ";