Merge pull request #305 from David96/master

Add support for "POWER_SUPPLY_STATUS=Not charging" (fixes #304)
This commit is contained in:
Ingo Bürk 2018-09-04 11:58:58 +02:00 committed by GitHub
commit 5c9d12befa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -179,7 +179,7 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
batt_info->status = CS_CHARGING;
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Full"))
batt_info->status = CS_FULL;
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Discharging"))
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Discharging") || BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Not charging"))
batt_info->status = CS_DISCHARGING;
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS="))
batt_info->status = CS_UNKNOWN;

View File

@ -0,0 +1 @@
POWER_SUPPLY_STATUS=Not charging

View File

@ -0,0 +1 @@
BAT

View File

@ -0,0 +1,10 @@
general {
output_format = "none"
}
order += "battery all"
battery all {
format = "%status"
path = "testcases/023-battery-not-charging/BAT%d_uevent"
}