-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erratic ValueError raised in get_power_mode() #289
Comments
Could also be related to #117. Does this only occur in standby mode? There are a number of monitors that simply don't respond to DDC-CI commands in standby. It is strange that this is erratic though. Perhaps check if there are some monitor power features you can tweak? |
Yes, I've only seen it after the display entered standby. I'm going to profile it a bit more, maybe I'll find some patterns that help debug the case. |
When I wait for Windows to put the display in sleep, it's erratic. #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from monitorcontrol import get_monitors, VCPError, PowerMode
from winsound import Beep
if __name__ == '__main__':
monitor = get_monitors()[0]
with monitor:
monitor.set_power_mode(PowerMode.off_soft)
while True:
for i, monitor in enumerate(get_monitors()):
with monitor:
try:
print(f"Monitor #{i}: {monitor.get_power_mode()}")
time.sleep(3)
except (VCPError, ValueError) as e:
while True:
Beep(450, 400)
time.sleep(0.1) Also, I updated to monitorcontrol 3.1.0 and the trace changed a bit:
Which resembles #288 (comment). I think I'm out of luck, but at least I know the issue is in my hardware. |
Changing closure state. |
monitorcontrol --version
): 3.0.3Steps to Reproduce
self._get_vcp_feature(code)
returns zero, thenPowerMode(value)
called with this 0 which raises{ValueError}0 is not a valid PowerMode
monitorcontrol/monitorcontrol/monitorcontrol.py
Lines 378 to 401 in a363456
#288 Seems related.
The text was updated successfully, but these errors were encountered: