From 28ca2dd3e84042d2bd9f5ecbbdf199adc484d54e Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 3 Jan 2024 11:38:17 -0800 Subject: [PATCH] Update `validate` method to support DSI displays and fix syntax errors --- ovos_gui_plugin_shell_companion/brightness.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ovos_gui_plugin_shell_companion/brightness.py b/ovos_gui_plugin_shell_companion/brightness.py index 2d4a056..870ad6d 100644 --- a/ovos_gui_plugin_shell_companion/brightness.py +++ b/ovos_gui_plugin_shell_companion/brightness.py @@ -58,12 +58,13 @@ def validate(): if not platform.machine().startswith("arm"): return False # check if needed utils installed - if self.vcgencmd is None: + if shutil.which("vcgencmd") is None: LOG.info("Missing vcgencmd command.") return False - if self.ddcutil is None: - LOG.info("Missing ddcutil command.") - return False + # ddcutil is used only for HDMI displays + if shutil.which("ddcutil"): + LOG.debug("ddcutil not available for HDMI display adjustments") + return True #### brightness manager - TODO generic non rpi support # Check if the auto dim is enabled