From a85f37dbad2027816c16d75cf7d5cc6236e184b6 Mon Sep 17 00:00:00 2001 From: miro Date: Sun, 18 Aug 2024 20:16:43 +0100 Subject: [PATCH] add TODO note https://github.com/OpenVoiceOS/ovos-shell/issues/45 --- ovos_gui_plugin_shell_companion/brightness.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ovos_gui_plugin_shell_companion/brightness.py b/ovos_gui_plugin_shell_companion/brightness.py index 3e7cf47..46fe243 100644 --- a/ovos_gui_plugin_shell_companion/brightness.py +++ b/ovos_gui_plugin_shell_companion/brightness.py @@ -61,8 +61,18 @@ def set_brightness(self, level: int): return # avoid log spam LOG.info(f"Brightness level set to {level}") self._brightness_level = level - self.bus.emit(Message("phal.brightness.control.auto.dim.update", - {"brightness": level})) + + # ovos-shell will BOTH reduce brightness via QML manipulation (fake) and + # emit "phal.brightness.control.set" to delegate to an external plugin + # this means we cant update slider without triggering fake brightness, + # TODO - ovos-shell https://github.com/OpenVoiceOS/ovos-shell/issues/45 + if self.fake_brightness: + # if an external plugin is also installed will reduce brightness TWICE (fake + real) + self.bus.emit(Message("phal.brightness.control.auto.dim.update", + {"brightness": level})) + else: # will NOT update ovos-shell slider + self.bus.emit(Message("phal.brightness.control.set", + {"brightness": level})) def get_brightness(self) -> int: """