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:
- raspberrypi/linux#2397:
/sys/devices/platform/soc/soc:firmware/get_trottled - raspberrypi/linux#2706:
/sys/class/hwmon/hwmon0/in0_lcrit_alarm
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.
Release files for rpi-bad-power 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rpi-bad-power-0.1.0.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rpi_bad_power-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:8.1 kB
Release files / rpi-bad-power-0.1.0.tar.gz
| Download URL | rpi-bad-power-0.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d9f6e2c3a4f213e4c61acf618880d6fd2a384fe26b4f35a64a9fdfa3a38d079
|
|
BLAKE2b-256 checksum How to use checksums |
93e4e6ab9c81148da6d1cbb7237402df6713c8b53852678285ee8ac826063347
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.9
|
Release files / rpi_bad_power-0.1.0-py3-none-any.whl
| Download URL | rpi_bad_power-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6deedda247d48c44cd62d5c6c67c80d774eab34e706262b05f5e6518a00f19b
|
|
BLAKE2b-256 checksum How to use checksums |
464d826fe801a1b6bc2fa352747a94f91fd4b85307ae962e226c208ec05046fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.9
|