dashboard: fix temp alert style repaint

This commit is contained in:
2026-06-19 02:07:50 -06:00
parent 73a28beacc
commit ef6b32e133
2 changed files with 3 additions and 19 deletions
@@ -1,6 +1,6 @@
#pragma once #pragma once
static const char *DASHBOARD_VERSION = "0.1.119-temp-alert-debug"; static const char *DASHBOARD_VERSION = "0.1.120-temp-alert-style-real-fix";
// Update these if your Cargo ESP AP credentials are different. // Update these if your Cargo ESP AP credentials are different.
//static const char *CARGO_WIFI_SSID = "OverlandController"; //static const char *CARGO_WIFI_SSID = "OverlandController";
@@ -1288,14 +1288,10 @@ static void update_temp_tile_alert_style(int index, bool alert)
return; return;
} }
if (last_temp_tile_alert[index] == alert) { // Always apply the visual style. The cache can get out of sync when pages
return; // are hidden/shown, so it must not prevent repainting the tile.
}
last_temp_tile_alert[index] = alert; last_temp_tile_alert[index] = alert;
lvgl_port_lock(-1);
if (alert) { if (alert) {
lv_obj_set_style_bg_color(temp_tile_objs[index], lv_color_hex(0x7A271A), 0); lv_obj_set_style_bg_color(temp_tile_objs[index], lv_color_hex(0x7A271A), 0);
lv_obj_set_style_border_color(temp_tile_objs[index], lv_color_hex(0xF97066), 0); lv_obj_set_style_border_color(temp_tile_objs[index], lv_color_hex(0xF97066), 0);
@@ -1305,11 +1301,8 @@ static void update_temp_tile_alert_style(int index, bool alert)
lv_obj_set_style_border_color(temp_tile_objs[index], lv_color_hex(0x2F3A46), 0); lv_obj_set_style_border_color(temp_tile_objs[index], lv_color_hex(0x2F3A46), 0);
lv_obj_set_style_border_width(temp_tile_objs[index], 2, 0); lv_obj_set_style_border_width(temp_tile_objs[index], 2, 0);
} }
lvgl_port_unlock();
} }
static void update_battery_card_alert_style(bool alert) static void update_battery_card_alert_style(bool alert)
{ {
if (battery_card_obj == nullptr) { if (battery_card_obj == nullptr) {
@@ -1465,15 +1458,6 @@ static void parse_status_json(const String &body)
float temp_f = (float)(temp["temperature_f"] | 0.0); float temp_f = (float)(temp["temperature_f"] | 0.0);
bool high_alert = temp["high_alert"] | false; bool high_alert = temp["high_alert"] | false;
Serial.printf(
"TEMP DEBUG: name=%s group=%s temp=%.1f high_alert=%d\n",
temp["name"] | "unknown",
temp["group"] | "",
temp_f,
high_alert ? 1 : 0
);
if (weather) { if (weather) {
outside_status = "OUT "; outside_status = "OUT ";
outside_status += String((int)round(temp_f)); outside_status += String((int)round(temp_f));