Fix battery showing at 0% if no battery is present
This commit is contained in:
parent
cf39ce0c9c
commit
38a7e04b93
@ -72,7 +72,9 @@ function parse_record(record, exit_on_absent) {
|
||||
}
|
||||
}
|
||||
name = props["native-path"]
|
||||
if ((! BATTERY && props["power supply"] == "yes" && \
|
||||
if (name == "") {
|
||||
return 0
|
||||
} else if ((! BATTERY && props["power supply"] == "yes" && \
|
||||
props["native-path"] ~ /BAT[0-9]+/) || name == BATTERY) {
|
||||
state_info["percentage"] = props["percentage"] + 0
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user