Add support for "POWER_SUPPLY_STATUS=Not charging" (fixes #304)

This commit is contained in:
David96 2018-09-03 20:50:36 +02:00
parent 38ead0249b
commit 6a5e5b8ac4

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;