diff --git a/firmware/esp32-s3-dashboard/dashboard_config.h b/firmware/esp32-s3-dashboard/dashboard_config.h index f648569..54ec1c0 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.29-force-relay-layout"; +static const char *DASHBOARD_VERSION = "0.1.30-relay-state-colors"; // 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 96f36f2..dc6ebb5 100644 --- a/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino +++ b/firmware/esp32-s3-dashboard/esp32-s3-dashboard.ino @@ -307,6 +307,24 @@ static void update_relay_buttons() label += on_off(relay_states[i]); lv_label_set_text(relay_button_labels[i], label.c_str()); + + if (relay_count >= 5) { + lv_obj_set_style_text_font(relay_button_labels[i], &lv_font_montserrat_30, 0); + } else { + lv_obj_set_style_text_font(relay_button_labels[i], &lv_font_montserrat_40, 0); + } + + if (relay_states[i]) { + lv_obj_set_style_bg_color(relay_buttons[i], lv_color_hex(0x027A48), 0); + lv_obj_set_style_border_color(relay_buttons[i], lv_color_hex(0x32D583), 0); + lv_obj_set_style_border_width(relay_buttons[i], 2, 0); + } else { + lv_obj_set_style_bg_color(relay_buttons[i], lv_color_hex(0x26313D), 0); + lv_obj_set_style_border_color(relay_buttons[i], lv_color_hex(0x3A4652), 0); + lv_obj_set_style_border_width(relay_buttons[i], 2, 0); + } + + lv_obj_set_style_text_color(relay_button_labels[i], lv_color_hex(0xFFFFFF), 0); } else { lv_obj_add_flag(relay_buttons[i], LV_OBJ_FLAG_HIDDEN); }