]> git.sur5r.net Git - i3/i3status/commitdiff
Added missing ampere to watt conversion for last full capacity. (#158)
authortnnn <tnnn@users.noreply.github.com>
Sun, 21 Aug 2016 20:11:19 +0000 (22:11 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Sun, 21 Aug 2016 20:11:19 +0000 (13:11 -0700)
Signed-off-by: Tomasz Nitecki <tnnn@tnnn.pl>
src/print_battery_info.c

index c7948d05a1c072a56dbd53bfcd00de121bd40a0d..c20e87e571f4104611367351bc816e04d6eda8ba 100644 (file)
@@ -105,6 +105,7 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
         batt_info->present_rate = (((float)voltage / 1000.0) * ((float)batt_info->present_rate / 1000.0));
         batt_info->remaining = (((float)voltage / 1000.0) * ((float)batt_info->remaining / 1000.0));
         batt_info->full_design = (((float)voltage / 1000.0) * ((float)batt_info->full_design / 1000.0));
+        batt_info->full_last = (((float)voltage / 1000.0) * ((float)batt_info->full_last / 1000.0));
     }
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
     int state;
@@ -307,6 +308,7 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
         batt_info->present_rate = (((float)voltage / 1000.0) * ((float)batt_info->present_rate / 1000.0));
         batt_info->remaining = (((float)voltage / 1000.0) * ((float)batt_info->remaining / 1000.0));
         batt_info->full_design = (((float)voltage / 1000.0) * ((float)batt_info->full_design / 1000.0));
+        batt_info->full_last = (((float)voltage / 1000.0) * ((float)batt_info->full_last / 1000.0));
     }
 
     if (is_full)