some updates
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import monitorcontrol
|
||||
|
||||
BRIGHTNESS = 10
|
||||
|
||||
def get_monitors():
|
||||
"""Retrieve a list of connected monitors."""
|
||||
return monitorcontrol.get_monitors()
|
||||
@@ -13,9 +15,16 @@ def set_brightness(monitor, brightness):
|
||||
print(f"Set brightness to {brightness}%")
|
||||
|
||||
|
||||
def chenge_brightness(args):
|
||||
def get_brightness(args):
|
||||
global BRIGHTNESS
|
||||
return {"value":BRIGHTNESS}
|
||||
|
||||
|
||||
def change_brightness(args):
|
||||
global BRIGHTNESS
|
||||
try:
|
||||
level = args.get('level', 10)
|
||||
BRIGHTNESS = level
|
||||
monitors = get_monitors()
|
||||
if not monitors:
|
||||
raise OSError(f"No DDC/CI compatible monitors found.")
|
||||
|
||||
Reference in New Issue
Block a user