Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 18, 2024
1 parent b723a8a commit a85f37d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ovos_gui_plugin_shell_companion/brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit a85f37d

Please sign in to comment.