Skip to content

Commit

Permalink
refactor: Add conditional check to prevent drawing battery icon when …
Browse files Browse the repository at this point in the history
…displayShowBattery is false
  • Loading branch information
melkati committed May 31, 2024
1 parent 2146a7e commit 60dfe4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CO2_Gadget_EINK.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ void initDisplay(bool fastMode = false) {

void showBatteryIcon(int32_t posX, int32_t posY, bool forceRedraw) {
publishMQTTLogData("-->[EINK] Battery Level: " + String(batteryLevel) + "% Battery voltage: " + String(batteryVoltage) + "V");
// Serial.println("-->[EINK] Drawn battery icon at " + String(posX) + ", " + String(posY) + " with level " + String(batteryLevel) + "% and voltage " + String(batteryVoltage) + "V");
display.fillRect(posX, posY, display.width() - posX, 16, GxEPD_WHITE);
if (!displayShowBattery) return;
if (workingOnExternalPower) {
// display.drawRoundRect(posX + 8, posY, 16 + 6, 16 + 6, 2, GxEPD_BLACK);
display.drawBitmap(posX + 16, posY, iconUSB, 16, 16, GxEPD_WHITE, GxEPD_BLACK);
Expand Down

0 comments on commit 60dfe4b

Please sign in to comment.