newAM/monitorcontrol

Crash when monitor do not support input_source

centy opened this issue · 1 comments

centy commented

My monitor do not retrun Input sources. I guess it is not supported. This cause crashe in monitor_obj.get_input_source() because code = vcp.VCPCode("input_select") return 0.
So in main.py extra if should be added
elif args.get_monitors:
for monitor_index, monitor_obj in enumerate(get_monitors(), 0):
with monitor_obj:
monitors_dict = monitor_obj.get_vcp_capabilities()
if (len(monitors_dict["inputs"])>0):
current_input = monitor_obj.get_input_source()
model = monitors_dict["model"]
inputs = monitors_dict["inputs"]
sys.stdout.write(f"Monitor {monitor_index + 1}: {model}" + "\n")
sys.stdout.write("Available Inputs:\n")
for i in inputs:
sys.stdout.write(f"\t{i}")
if i == current_input:
sys.stdout.write("*\n")
else:
sys.stdout.write("\n")

    return
newAM commented

Probably covered by #63
I realized I forgot to make a release for that. I just pushed 2.4.2 which will hopefully fix this.

All that aside, as far as I know the MCCS version 2.2a (which this is based on) requires that input source be supported.