Skip to main content

A Python library to detect bad power supply on Raspberry Pi .

Project description

rpi-bad-power

A Python library to detect bad power supply on Raspberry Pi. This library is mainly built for the Raspberry Pi Power Supply Checker integration of HomeAssistant. It should also work for other purpose.

Compatibility

This library only works on kernel 4.14+. It supports getting the under voltage bit from different entries.

Related PRs:

Usage

Here is an example on how to use this library.

from rpi_bad_power import new_under_voltage

under_voltage = new_under_voltage()
if under_voltage is None:
    print("System not supported.")
elif under_voltage.get():
    print("Under voltage detected.")
else:
    print("Voltage is normal.")

Credits

Some of the code are based on custom-components/sensor.rpi_power maintained by @swetoast.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpi-bad-power-0.1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

rpi_bad_power-0.1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page