Sennevds / system_sensors

Logging of system sensor specific for the RPI and sending them to a MQTT broker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: having 'power_status' set to True in settings raises an error on x86 arch host while sending initial mqtt config

MaxVRAM opened this issue · comments

Tested only on an Intel NUC x86_64

The rpi_bad_power library imports fine in pip even on this system, but returns None, causing a NoneType error.

commented

RPI bad power is like the name only for RPI so it won't work on other devices.

So the library imports without raising an error, even on systems where the function won't return a valid result, such as my x86 NUC.

Previously, there was only a check in the sensors.py to disable the power_status call if the library import raise an exception, but didn't account for a successful import and None return on incompatible architecture; this was crashing system_sensors on my NUC.

I solved this in my pull request by just adding a None check on the power status function after a successful library import.

commented

Hi Max I think this issue can be closed no?