From a2fd4bd07424a1df80c5ee7bc9f958e4ab6bafcd Mon Sep 17 00:00:00 2001 From: tnnn Date: Sun, 21 Aug 2016 22:11:19 +0200 Subject: Added missing ampere to watt conversion for last full capacity. (#158) Signed-off-by: Tomasz Nitecki --- src/print_battery_info.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.3