summaryrefslogtreecommitdiff
path: root/src/print_battery_info.c
diff options
context:
space:
mode:
authorTommie Gannert <tommie@gannert.se>2016-08-01 20:17:50 +0100
committerTommie Gannert <tommie@gannert.se>2016-08-14 20:44:54 +0100
commit9970af67e59dfbc758f6158a187c56fa4f3b557a (patch)
treeddc51d1151ddff475f5b35075bcd4e3471e118ef /src/print_battery_info.c
parent6e4ca31aa5febcc546ec3b32a09793085ea114f0 (diff)
Also capture charge rate in NetBSD.
For time estimates when charging.
Diffstat (limited to 'src/print_battery_info.c')
-rw-r--r--src/print_battery_info.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index a97bdea..f131601 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -326,6 +326,9 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
} else if (strcmp("discharge rate", prop_string_cstring_nocopy(obj3)) == 0) {
obj3 = prop_dictionary_get(obj2, "cur-value");
batt_info->present_rate = prop_number_integer_value(obj3);
+ } else if (strcmp("charge rate", prop_string_cstring_nocopy(obj3)) == 0) {
+ obj3 = prop_dictionary_get(obj2, "cur-value");
+ batt_info->present_rate = prop_number_integer_value(obj3);
} else if (strcmp("last full cap", prop_string_cstring_nocopy(obj3)) == 0) {
obj3 = prop_dictionary_get(obj2, "cur-value");
last_full_cap = prop_number_integer_value(obj3);