Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Fix for #3
Browse files Browse the repository at this point in the history
Check against 100 :)
  • Loading branch information
jamesmontemagno authored Dec 5, 2016
1 parent 26ee76a commit ed03d64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Battery.Plugin.UWP/BatteryImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public override BatteryStatus Status

var percentage = RemainingChargePercent;

if (percentage >= 1.0)
if (percentage >= 100)
status = BatteryStatus.Full;
else if (percentage < 0)
status = BatteryStatus.Unknown;
Expand Down Expand Up @@ -122,7 +122,8 @@ public override Abstractions.PowerSource PowerSource
{
get
{
if (status == BatteryStatus.Full || status == BatteryStatus.Charging)
var currentStatus = Status;
if (currentStatus == BatteryStatus.Full || currentStatus == BatteryStatus.Charging)
return Abstractions.PowerSource.Ac;

return Abstractions.PowerSource.Battery;
Expand Down Expand Up @@ -152,4 +153,4 @@ public override void Dispose(bool disposing)
base.Dispose(disposing);
}
}
}
}

0 comments on commit ed03d64

Please sign in to comment.