how can I read the upower UPS battery state from a file?

Asked by Keith Myers on 2019-10-04

I have old outdated code in the BOINC client that tries to read the state of system batteries from outdated and old interfaces. The current upower interface seems to be the current and modern interface to use. But I can't determine if upower sets the power state in any discrete system file that can be read from the client code. It looks like the only way to poll the state is to use the upower command line interface which would be much harder to code and is not a simple drop in.

What I would like is to inform the BOINC client that the system has switched off from mains power to UPS standby power so that the client can shed compute load. The client mechanism works correctly for a Windows host but is ignored by Linux hosts.

I think the code needs to be updated in the file so that a new method for upower is added. But I am not a programmer and need help. The BOINC project does not have any current Linux programmers.

Can somebody suggest what changes to be made to this module to use the upower interface to determine the status of when the host goes onto UPS standby power. Thanks for any help.

Question information

English Edit question
Ubuntu upower Edit question
No assignee Edit question
Last query:
Last reply:
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.