Refactor DDM backend to use monitorcontrol for input switching and update error messages for clarity
This commit is contained in:
+4
-4
@@ -122,9 +122,9 @@ class KvmSwitcherService:
|
||||
ddm_slot is not None or supports_monitor_targeting
|
||||
)
|
||||
if not self.ddm_backend.is_available():
|
||||
errors.append("DDM.exe was not found.")
|
||||
errors.append("Alienware monitorcontrol backend is not ready.")
|
||||
elif ddm_slot is None and not supports_monitor_targeting:
|
||||
errors.append("Alienware DDM slot could not be resolved.")
|
||||
errors.append("Alienware monitorcontrol target could not be resolved.")
|
||||
|
||||
trigger_target_port = self._port_name_for_input_code(scan.trigger_input_code)
|
||||
desired_port = self._resolve_desired_port(config, scan)
|
||||
@@ -279,7 +279,7 @@ class KvmSwitcherService:
|
||||
return "waiting_for_trigger_match", last_switch_at, scan, errors
|
||||
if verify_scan.alienware_input_code is None:
|
||||
errors.append(
|
||||
"Alienware input could not be read after switch; assuming success because DDM command completed."
|
||||
"Alienware input could not be read after switch; assuming success because switch command completed."
|
||||
)
|
||||
self._samsung_session_successful = True
|
||||
return "switched_unverified", last_switch_at, scan, errors
|
||||
@@ -307,7 +307,7 @@ def _is_blocking_error(error: str) -> bool:
|
||||
normalized = error.strip()
|
||||
non_blocking_prefixes = (
|
||||
"Unable to read Alienware target monitor input source:",
|
||||
"Alienware input could not be read after switch; assuming success because DDM command completed.",
|
||||
"Alienware input could not be read after switch; assuming success because switch command completed.",
|
||||
"Samsung trigger monitor did not expose a Samsung model in DDC/CI; using the only non-Alienware DDC monitor as trigger.",
|
||||
)
|
||||
return not any(normalized.startswith(prefix) for prefix in non_blocking_prefixes)
|
||||
|
||||
Reference in New Issue
Block a user