From fdf759a7054a3838299a4856fd7a7cfb1570b520 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sun, 4 Feb 2024 21:06:12 -0500 Subject: [PATCH] ui: handle backlight notification --- lib/logitech_receiver/notifications.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/logitech_receiver/notifications.py b/lib/logitech_receiver/notifications.py index 3e3de9df4f..7ebc517882 100644 --- a/lib/logitech_receiver/notifications.py +++ b/lib/logitech_receiver/notifications.py @@ -410,6 +410,14 @@ def _process_feature_notification(device, status, n, feature): else: _log.warn('%s: unknown REPROG_CONTROLS %s', device, n) + elif feature == _F.BACKLIGHT2: + if (n.address == 0x00): + level = _unpack('!B', n.data[1:2])[0] + from solaar.ui.config_panel import record_setting # prevent circular import + setting = next((s for s in device.settings if s.name == _st.Backlight2.name), None) + if setting: + record_setting(device, setting, [level]) + elif feature == _F.REPROG_CONTROLS_V4: if n.address == 0x00: if _log.isEnabledFor(_DEBUG):