dashboard: show idle battery state
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user