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:
- 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.
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for rpi_bad_power-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6deedda247d48c44cd62d5c6c67c80d774eab34e706262b05f5e6518a00f19b |
|
MD5 | ef29e3329646b5e61907232cca1718e7 |
|
BLAKE2b-256 | 464d826fe801a1b6bc2fa352747a94f91fd4b85307ae962e226c208ec05046fd |