Reset switch session on trigger changes and add DP2 force helper
This commit is contained in:
+20
-5
@@ -1,7 +1,22 @@
|
||||
from monitorcontrol import get_monitors, InputSource
|
||||
from monitorcontrol import get_monitors
|
||||
|
||||
|
||||
TARGET_MODEL = "AW3423DWF"
|
||||
DP2_CODE = 19
|
||||
|
||||
|
||||
for monitor in get_monitors():
|
||||
with monitor:
|
||||
print(monitor.vcp.description)
|
||||
input_source_raw: int = monitor.get_input_source()
|
||||
print(InputSource(input_source_raw).name)
|
||||
description = str(getattr(getattr(monitor, "vcp", None), "description", "") or str(monitor))
|
||||
if TARGET_MODEL not in description.upper():
|
||||
continue
|
||||
|
||||
try:
|
||||
with monitor:
|
||||
monitor.set_input_source(DP2_CODE)
|
||||
print(f"Target: {description}")
|
||||
print(f"Forced DP2 code {DP2_CODE}.")
|
||||
except Exception as exc:
|
||||
print(f"Failed forcing DP2 on {description}: {exc}")
|
||||
break
|
||||
else:
|
||||
print(f"Monitor {TARGET_MODEL} not found.")
|
||||
|
||||
Reference in New Issue
Block a user