From 7b0ccf226e8d28c10344383c498c76f8dfbefce0 Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 10 Jun 2026 02:16:05 -0600 Subject: [PATCH] dashboard: show idle battery state --- firmware/esp32-s3-dashboard/dashboard_config.h | 2 +- .../esp32-s3-dashboard/esp32-s3-dashboard.ino | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/firmware/esp32-s3-dashboard/dashboard_config.h b/firmware/esp32-s3-dashboard/dashboard_config.h index a729b56..fccaa90 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.19-voltage-cleanup"; +static const char *DASHBOARD_VERSION = "0.1.20-battery-idle-state"; // 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 73c5d4a..3a3b659 100644 --- a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino +++ b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino @@ -171,15 +171,9 @@ static void update_battery_current_label(const String &text, float current) } lvgl_port_lock(-1); - - if (text.length() == 0) { - lv_obj_add_flag(battery_current_label, LV_OBJ_FLAG_HIDDEN); - } else { - lv_obj_clear_flag(battery_current_label, LV_OBJ_FLAG_HIDDEN); - lv_label_set_text(battery_current_label, text.c_str()); - lv_obj_set_style_text_color(battery_current_label, current_color, 0); - } - + lv_obj_clear_flag(battery_current_label, LV_OBJ_FLAG_HIDDEN); + lv_label_set_text(battery_current_label, text.c_str()); + lv_obj_set_style_text_color(battery_current_label, current_color, 0); lvgl_port_unlock(); } @@ -481,6 +475,10 @@ static void update_overview_widgets() } else if (status_model.current < -0.05 && status_model.remaining_ah > 0.0) { estimate_text = "Runtime " + format_hours(status_model.remaining_ah / abs(status_model.current)); } + } else { + current_text = "Idle"; + estimate_text = ""; + } } String soc_text;