From c302bde0fa15308d6390f5388d8a8611100101a9 Mon Sep 17 00:00:00 2001 From: agfa Date: Mon, 14 Jul 2025 08:55:33 -0400 Subject: [PATCH] add SCS command to version 4 --- monitorcontrol/vcp/vcp_windows.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/monitorcontrol/vcp/vcp_windows.py b/monitorcontrol/vcp/vcp_windows.py index c15abf1..908b319 100644 --- a/monitorcontrol/vcp/vcp_windows.py +++ b/monitorcontrol/vcp/vcp_windows.py @@ -148,7 +148,23 @@ def get_vcp_capabilities(self): except OSError as e: raise VCPError("failed to get VCP capabilities") from e return cap_string.value.decode("ascii") + + def save_current_settings(self): + """ + Saves the current settings to monitor NVRAM. + Raises: + VCPError: Failed to set VCP feature. + """ + self.logger.debug("SaveCurrentSettingsCommand") + try: + if not ctypes.windll.dxva2.SaveCurrentSettings( + HANDLE(self.handle) + ): + raise VCPError("failed to save current settings: " + ctypes.FormatError()) + except OSError as e: + raise VCPError("failed to close handle") from e + @staticmethod def _get_physical_monitors() -> Iterator[Tuple[HANDLE, str]]: """