[chiglug] Uninterruptable Power Supplies Under sysfs

eviljoel eviljoel at linux.com
Thu Mar 29 02:33:58 UTC 2018


Greetings,

I'm writing a Python program that does something based on the state of
an Uninterruptable Power Supply (UPS) being plugged into the wall or
not. I would like to use the psutil Python library to check the state of
the battery, however, this depends on the UPS registering under the
/sys/class/power_supply directory (typically used by laptop batteries).
I tested this with my old APC Back-UPS RS 1500VA and it didn't register
under sysfs, but that UPS was created over 10 years ago. Newer UPSes are
more likely to work favorably.

I'm sure someone on one of these two mailing lists is running Linux on a
computer connected to a modern (non-laptop) UPS. If you are that person,
can you tell me whether your UPS is registered under
/sys/class/power_supply?

In case anyone is wondering. I am specifically targeting Ubuntu 18.04
LTS, so portability isn't really a concern.

Thank you,
eviljoel

-- 
Let me teach you encrypted e-mail. eviljoel's PGP fingerprint:
A2BE 2D12 24D1 67CA 8830  DDE7 DFB3 676B 196D 6430

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.chicagolug.org/pipermail/discuss/attachments/20180328/3df43449/attachment.sig>


More information about the discuss mailing list