WLAN-Pi / wlanpi-fpms

Front Panel Menu System for WLAN Pi RPi and CM4 hardware
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Fix crash when platform is WLAN Pi Pro #127

Closed joshschmelzle closed 2 weeks ago

joshschmelzle commented 2 weeks ago

Type of change

Breaking change

Does this Pull Request introduce a breaking change?

No

Proposed change

Please describe the purpose of this change, the problem it solves, and why the change is necessary. Include code snippets or links to related documentation when applicable

This PR fixes the following crash which occurred when running v1.4.5 on the WLAN Pi Pro.

Oct 15 12:10:40 wlanpi-087 fpms[639]: Traceback (most recent call last):
Oct 15 12:10:40 wlanpi-087 fpms[639]:   File "/usr/sbin/fpms", line 5, in <module>
Oct 15 12:10:40 wlanpi-087 fpms[639]:     from fpms.__main__ import main
Oct 15 12:10:40 wlanpi-087 fpms[639]:   File "/opt/wlanpi-fpms/lib/python3.9/site-packages/fpms/__main__.py", line 3, in <module>
Oct 15 12:10:40 wlanpi-087 fpms[639]:     sys.exit(fpms.main())
Oct 15 12:10:40 wlanpi-087 fpms[639]:   File "/opt/wlanpi-fpms/lib/python3.9/site-packages/fpms/fpms.py", line 279, in main
Oct 15 12:10:40 wlanpi-087 fpms[639]:     oled.init()
Oct 15 12:10:40 wlanpi-087 fpms[639]:   File "/opt/wlanpi-fpms/lib/python3.9/site-packages/fpms/modules/wlanpi_oled.py", line 22, in init
Oct 15 12:10:40 wlanpi-087 fpms[639]:     device.init()
Oct 15 12:10:40 wlanpi-087 fpms[639]:   File "/opt/wlanpi-fpms/lib/python3.9/site-packages/fpms/modules/screen/luma.py", line 191, in init
Oct 15 12:10:40 wlanpi-087 fpms[639]:     device.contrast(128)
Oct 15 12:10:40 wlanpi-087 fpms[639]: NameError: name 'device' is not defined

Testing

Please explain how you tested this change manually, and if applicable, what new tests you added.

Checklist

Related Issues/PRs