Skip to content

Commit

Permalink
Merge pull request #111 from mastercaution/fix/fully_charged
Browse files Browse the repository at this point in the history
Fixed fully charged bug #108
  • Loading branch information
fin-ger authored Apr 4, 2020
2 parents fc876ac + 1498f22 commit 7af7c14
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ var CPUFreqIndicator = class CPUFreqIndicator extends baseindicator.CPUFreqBaseI
}

powerActions(powerState) {
if (powerState === UPower.DeviceState.FULLY_CHARGED)
{
global.log ("Power state changed: fully charged");
}
else if (powerState === UPower.DeviceState.DISCHARGING)
if (powerState === UPower.DeviceState.DISCHARGING)
{
global.log ("Power state changed: discharging");
// switch to battery profile if auto switching is enabled
Expand All @@ -135,9 +131,13 @@ var CPUFreqIndicator = class CPUFreqIndicator extends baseindicator.CPUFreqBaseI
}
}
}
else if (powerState === UPower.DeviceState.CHARGING)
else if (powerState === UPower.DeviceState.CHARGING ||
powerState === UPower.DeviceState.FULLY_CHARGED)
{
global.log ("Power state changed: charging");
if (powerState === UPower.DeviceState.CHARGING)
global.log ("Power state changed: charging");
else
global.log ("Power state changed: fully charged");
// switch to AC profile if auto switching is enabled
if (this.isAutoSwitchActive)
{
Expand Down

0 comments on commit 7af7c14

Please sign in to comment.