diff options
-rwxr-xr-x | battery | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -56,13 +56,12 @@ sub update { my $full = $bs->{energy_full} // $bs->{charge_full}; my $deriv = $bs->{power_now} // $bs->{current_now}; - my $e=$now/$full; + my $fraction = $now/$full; my $charging = lc($bs->{status}) eq 'charging'; my $is_full = lc($bs->{status}) eq 'full'; my @symbols; my $time_estimate=''; - my $percentage=sprintf '%.0f%%', 100*$e; - my $fraction=$e; + my $percentage=sprintf '%.0f%%', 100*$fraction; if ($deriv) { my $t=( $charging ? $full - $now : $now )/$deriv; @@ -71,7 +70,6 @@ sub update { $time_estimate = sprintf "%s/%s", _format_time($t), _format_time($tot); - $fraction= $now / $full; } if ($charging) { |