mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
Check that a UPower battery device IsPresent
The composite DisplayDevice is meant to be presented to the user only if it IsPresent. It is not entirely clear whether PowerSupply implies IsPresent, so check both (bug#80229). * lisp/battery.el (battery-upower): Skip hot-removable batteries that are missing from the bay.
This commit is contained in:
parent
0a02ab6db8
commit
aa9acfacf0
1 changed files with 4 additions and 2 deletions
|
|
@ -914,8 +914,10 @@ The following %-sequences are provided:
|
|||
((and (eq type 1) (not (eq line-status 'online)))
|
||||
;; It's a line power device: `online' if currently providing
|
||||
;; power, any other non-nil value if simply present.
|
||||
(setq line-status (if (cdr (assoc "Online" props)) 'online t)))
|
||||
((and (eq type 2) (cdr (assoc "IsPresent" props)))
|
||||
(setq line-status (or (not (cdr (assoc "Online" props))) 'online)))
|
||||
((and (eq type 2)
|
||||
(cdr (assoc "PowerSupply" props))
|
||||
(cdr (assoc "IsPresent" props)))
|
||||
;; It's a battery.
|
||||
(setq count (1+ count))
|
||||
(setq state (battery--upower-state props state))
|
||||
|
|
|
|||
Loading…
Reference in a new issue