From: tnnn Date: Sun, 21 Aug 2016 20:11:19 +0000 (+0200) Subject: Added missing ampere to watt conversion for last full capacity. (#158) X-Git-Tag: 2.11~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2fd4bd07424a1df80c5ee7bc9f958e4ab6bafcd;p=i3%2Fi3status Added missing ampere to watt conversion for last full capacity. (#158) Signed-off-by: Tomasz Nitecki --- diff --git a/src/print_battery_info.c b/src/print_battery_info.c index c7948d0..c20e87e 100644 --- a/src/print_battery_info.c +++ b/src/print_battery_info.c @@ -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)