Skip to content
Snippets Groups Projects
Commit a1bc2a84 authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

pt/test_panel_brightness: Test max_brightness as well

This makes sure we don't regress on brightness conversion
parent 7491ed6a
No related branches found
No related tags found
No related merge requests found
import os
from . import boardtype
from . import sysfs
def test_panel_brightness():
"Check if panel brighness range"
path = "/sys/class/backlight/backlight-dsi"
upper = 228 if boardtype.is_librem5() else 100
mb_path = os.path.join(path, 'max_brightness')
sysfs.check_content_in_glob("{}\n".format(upper), mb_path)
f = open(os.path.join(path, 'brightness'))
assert int(f.read()) in range(0, upper + 1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment