Skip to content

Commit

Permalink
Added charging state to the uploader battery pill when it's provided …
Browse files Browse the repository at this point in the history
…by AAPSClientV3. (nightscout#7873)

Co-authored-by: Sulka Haro <sulka@sulka.net>
  • Loading branch information
yodax and sulkaharo committed Feb 18, 2023
1 parent d1fe8f5 commit 0f69153
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/upbat.js
Expand Up @@ -72,6 +72,7 @@ function init(ctx) {

var battery = uploaderStatus.battery;
var voltage = uploaderStatus.batteryVoltage;
var charging = status.isCharging ? status.isCharging : false;
var voltageDisplay;

if (voltage) {
Expand All @@ -93,7 +94,7 @@ function init(ctx) {
uploaderStatus.voltageDisplay = voltageDisplay;
}

uploaderStatus.display = battery ? battery + '%' : voltageDisplay;
uploaderStatus.display = (battery ? battery + '%' : voltageDisplay) + (charging ? "⚡" : "");

if (battery >= 95) {
uploaderStatus.level = 100;
Expand Down

0 comments on commit 0f69153

Please sign in to comment.