mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-14 16:08:07 +00:00
Compare commits
1 Commits
main
...
fix_early_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
211389cffa |
@@ -174,11 +174,15 @@ void LvglDisplay::UpdateStatusBar(bool update_all) {
|
||||
lv_label_set_text(battery_label_, battery_icon_);
|
||||
}
|
||||
|
||||
if (low_battery_popup_ != nullptr) {
|
||||
// Check low battery popup only when clock tick event is triggered
|
||||
// Because when initializing, the battery level is not ready yet.
|
||||
if (low_battery_popup_ != nullptr && !update_all) {
|
||||
if (strcmp(icon, FONT_AWESOME_BATTERY_EMPTY) == 0 && discharging) {
|
||||
if (lv_obj_has_flag(low_battery_popup_, LV_OBJ_FLAG_HIDDEN)) { // Show if low battery popup is hidden
|
||||
lv_obj_remove_flag(low_battery_popup_, LV_OBJ_FLAG_HIDDEN);
|
||||
app.PlaySound(Lang::Sounds::OGG_LOW_BATTERY);
|
||||
app.Schedule([&app]() {
|
||||
app.PlaySound(Lang::Sounds::OGG_LOW_BATTERY);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Hide the low battery popup when the battery is not empty
|
||||
|
||||
Reference in New Issue
Block a user