dashboard: repair battery update region
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
static const char *DASHBOARD_VERSION = "0.1.21-fix-battery-widget-update";
|
static const char *DASHBOARD_VERSION = "0.1.22-repair-battery-update";
|
||||||
|
|
||||||
// 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";
|
||||||
|
|||||||
@@ -459,6 +459,7 @@ static void update_system_status_label()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void update_overview_widgets()
|
static void update_overview_widgets()
|
||||||
{
|
{
|
||||||
String current_text = "Idle";
|
String current_text = "Idle";
|
||||||
@@ -499,29 +500,6 @@ static void update_overview_widgets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String soc_text;
|
|
||||||
soc_text += status_model.soc >= 0 ? String(status_model.soc) : "--";
|
|
||||||
soc_text += "%";
|
|
||||||
|
|
||||||
update_battery_soc_gauge();
|
|
||||||
set_label_text_if_changed(battery_soc_label, last_battery_soc_text, soc_text);
|
|
||||||
update_battery_current_label(current_text, status_model.current);
|
|
||||||
|
|
||||||
if (battery_estimate_label != nullptr) {
|
|
||||||
set_label_text_if_changed(battery_estimate_label, last_battery_estimate_text, estimate_text);
|
|
||||||
lvgl_port_lock(-1);
|
|
||||||
if (estimate_text.length() == 0) {
|
|
||||||
lv_obj_add_flag(battery_estimate_label, LV_OBJ_FLAG_HIDDEN);
|
|
||||||
} else {
|
|
||||||
lv_obj_clear_flag(battery_estimate_label, LV_OBJ_FLAG_HIDDEN);
|
|
||||||
}
|
|
||||||
lvgl_port_unlock();
|
|
||||||
}
|
|
||||||
set_label_text_if_changed(system_status_label, last_system_status_text, last_system_status_text);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void parse_status_json(const String &body)
|
static void parse_status_json(const String &body)
|
||||||
{
|
{
|
||||||
DynamicJsonDocument doc(16000);
|
DynamicJsonDocument doc(16000);
|
||||||
|
|||||||
Reference in New Issue
Block a user