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

Doesn't work with hdmi on raspberry pi 4 #16

Closed rusikf closed 5 years ago

rusikf commented 5 years ago

Hi, I install your tool as on README on Raspberry pi 4 ( Raspbian OS) I want to change brightness on my external monitor, connected through microhdmi Do you have any ideas, how to fix it ? Thanks!

pi@raspberrypi:~ $ rpi-backlight --set-brightness 20
Traceback (most recent call last):
  File "/home/pi/.local/bin/rpi-backlight", line 10, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/rpi_backlight/cli.py", line 62, in main
    backlight = Backlight()
  File "/home/pi/.local/lib/python3.7/site-packages/rpi_backlight/__init__.py", line 39, in __init__
    self._max_brightness = self._get_value("max_brightness")  # 255
  File "/home/pi/.local/lib/python3.7/site-packages/rpi_backlight/__init__.py", line 52, in _get_value
    raise e
  File "/home/pi/.local/lib/python3.7/site-packages/rpi_backlight/__init__.py", line 44, in _get_value
    return int((self._backlight_sysfs_path / name).read_text())
  File "/usr/lib/python3.7/pathlib.py", line 1199, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.7/pathlib.py", line 1186, in open
    opener=self._opener)
  File "/usr/lib/python3.7/pathlib.py", line 1039, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/backlight/rpi_backlight/max_brightness'
linusg commented 5 years ago

Read carefully.

A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display.

Support for other displays, including HDMI, was and never will be part of this library. HDMI doesn't even have a standard way of changing the device brightness on a hardware level.