From bc2bcdeeecbfd4f3cf81bdd89ed80c9f3e57eb04 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 9 Jun 2026 22:48:35 -0600 Subject: [PATCH] dashboard: fix overview label widths --- .../esp32-s3-dashboard/esp32-s3-dashboard.ino | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino index 503ff43..d4a11dc 100644 --- a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino +++ b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino @@ -249,6 +249,16 @@ static void parse_status_json(const String &body) status_model.temps_text = temps; status_model.outputs_text = outputs; + Serial.println("Parsed status summary:"); + Serial.print(" SOC: "); + Serial.println(status_model.soc); + Serial.print(" Voltage: "); + Serial.println(status_model.voltage); + Serial.print(" Temps text: "); + Serial.println(status_model.temps_text); + Serial.print(" Outputs text: "); + Serial.println(status_model.outputs_text); + update_overview_widgets(); } @@ -398,12 +408,13 @@ static lv_obj_t *create_card(lv_obj_t *parent, const char *title, int width, int return card; } -static lv_obj_t *create_body_label(lv_obj_t *card) +static lv_obj_t *create_body_label(lv_obj_t *card, int width) { lv_obj_t *label = lv_label_create(card); lv_label_set_text(label, "Waiting for /api/v1/status..."); lv_obj_set_style_text_color(label, lv_color_hex(0xDDE3EA), 0); - lv_obj_set_width(label, lv_obj_get_width(card) - 34); + lv_obj_set_width(label, width); + lv_label_set_long_mode(label, LV_LABEL_LONG_WRAP); lv_obj_align(label, LV_ALIGN_TOP_LEFT, 0, 32); return label; } @@ -433,20 +444,21 @@ static void create_overland_status_screen() lv_obj_t *system_card = create_card(screen, "System / Network", 620, 190, LV_ALIGN_BOTTOM_LEFT, 32, -50); lv_obj_t *touch_card = create_card(screen, "Touch", 300, 190, LV_ALIGN_BOTTOM_RIGHT, -32, -50); - battery_label = create_body_label(battery_card); - temps_label = create_body_label(temps_card); - outputs_label = create_body_label(outputs_card); + battery_label = create_body_label(battery_card, 260); + temps_label = create_body_label(temps_card, 260); + outputs_label = create_body_label(outputs_card, 260); lv_label_set_text(battery_label, "Waiting for battery data..."); lv_label_set_text(temps_label, "Waiting for temp data..."); lv_label_set_text(outputs_label, "Waiting for output data..."); - wifi_label = create_body_label(system_card); + wifi_label = create_body_label(system_card, 275); system_label = lv_label_create(system_card); lv_label_set_text(system_label, "API: waiting"); lv_obj_set_style_text_color(system_label, lv_color_hex(0xB8C0C8), 0); - lv_obj_set_width(system_label, 300); + lv_obj_set_width(system_label, 285); + lv_label_set_long_mode(system_label, LV_LABEL_LONG_WRAP); lv_obj_align(system_label, LV_ALIGN_TOP_LEFT, 305, 32); lv_obj_t *button = lv_btn_create(touch_card);