diff --git a/src/Battery.Plugin.UWP/BatteryImplementation.cs b/src/Battery.Plugin.UWP/BatteryImplementation.cs index 21e0aa1..e5c02dc 100644 --- a/src/Battery.Plugin.UWP/BatteryImplementation.cs +++ b/src/Battery.Plugin.UWP/BatteryImplementation.cs @@ -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; @@ -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; @@ -152,4 +153,4 @@ public override void Dispose(bool disposing) base.Dispose(disposing); } } -} \ No newline at end of file +}