So setzen Sie die Bildschirmhelligkeit automatisch, je nach Batterieprozentsatz mit Python

import psutil
import screen_brightness_control as screen
while True:
    battery =  psutil.sensors_battery()
    if battery.power_plugged == True:
        screen.set_brightness(50)
    elif battery.percent >= 30 and battery.power_plugged == False:
        screen.set_brightness(0)
Programmer of empires