Merge pull request #305 from David96/master
Add support for "POWER_SUPPLY_STATUS=Not charging" (fixes #304)
This commit is contained in:
commit
5c9d12befa
@ -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;
|
||||
|
1
testcases/023-battery-not-charging/BAT0_uevent
Normal file
1
testcases/023-battery-not-charging/BAT0_uevent
Normal file
@ -0,0 +1 @@
|
||||
POWER_SUPPLY_STATUS=Not charging
|
1
testcases/023-battery-not-charging/expected_output.txt
Normal file
1
testcases/023-battery-not-charging/expected_output.txt
Normal file
@ -0,0 +1 @@
|
||||
BAT
|
10
testcases/023-battery-not-charging/i3status.conf
Normal file
10
testcases/023-battery-not-charging/i3status.conf
Normal 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"
|
||||
}
|
Loading…
Reference in New Issue
Block a user