Detect full charge and improve watchface display

This commit is contained in:
Riku Isokoski
2021-09-03 14:35:38 +03:00
parent 6f9f0e8b0e
commit fd52ca8fe6
9 changed files with 75 additions and 26 deletions

View File

@@ -60,10 +60,10 @@ void BatteryInfo::Refresh() {
batteryPercent = batteryController.PercentRemaining();
batteryVoltage = batteryController.Voltage();
if (batteryController.IsCharging() and batteryPercent < 100) {
if (batteryController.IsCharging()) {
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
lv_label_set_text_static(status, "Charging");
} else if (batteryPercent == 100) {
} else if (batteryController.IsFull()) {
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_BLUE);
lv_label_set_text_static(status, "Fully charged");
} else if (batteryPercent < 10) {