linusg / rpi-backlight

🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display
https://rpi-backlight.readthedocs.io
MIT License
274 stars 31 forks source link

Trouble with TinkerBoard #41

Closed chris0z closed 2 years ago

chris0z commented 2 years ago

Installed with pip3 and created udev Rule. but get this error when I try to execute the Script:

linaro@tinkerboard:~$ rpi-backlight Traceback (most recent call last): File "/home/linaro/.local/bin/rpi-backlight", line 7, in from rpi_backlight.cli import main File "/home/linaro/.local/lib/python3.5/site-packages/rpi_backlight/init.py", line 55 f"board_type must be a member of the BoardType enum, got {type(board_type)}"

chris0z commented 2 years ago

Installed 2.3.0 and adapted init.py : BACKLIGHT_SYSFS_PATHS = { BoardType.RASPBERRY_PI:"/sys/class/backlight/panel_backlight/",

Now its working with Python 3.5

p1r473 commented 2 years ago

Can you print the output of cat /proc/device-tree/model It should work natively with TinkerBoard

linusg commented 2 years ago

It should work natively with TinkerBoard

It does, but support for Python 3.5 has been dropped - both from Python itself, and from this project. f-strings are a Python 3.6+ feature, so they are a syntax error in earlier versions (pretty sure that's what the error is about, even if the final line and actual error is missing). To put this into perspective, the initial release of 3.5 was in 2015, and the current version in 3.10 - you should upgrade :)