From df2a68c29ef12fc89d3fa15d78f5ab1f1739d3cb Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 17 Feb 2022 17:19:46 -0500 Subject: [PATCH] settings: add Backlight setting template --- lib/logitech_receiver/settings_templates.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index 616127aa..c37b8f27 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -197,11 +197,21 @@ class K375sFnSwap(FnSwapVirtual): validator_options = {'true_value': b'\x01', 'false_value': b'\x00', 'read_skip_byte_count': 1} -# we should allow the users to select which settings they want to enable. -class Backlight2(_Setting): - name = 'backlight' +class BacklightVirtual(_Setting): label = _('Backlight') description = _('Turn illumination on or off on keyboard.') + + +class Backlight(BacklightVirtual): + name = 'backlight-timed' + feature = _F.BACKLIGHT + choices_universe = _NamedInts(Off=0, Short=5, Medium=20, Long=60, VeryLong=180) + validator_class = _ChoicesV + validator_options = {'choices': choices_universe} + + +class Backlight2(BacklightVirtual): + name = 'backlight' feature = _F.BACKLIGHT2 @@ -1045,6 +1055,7 @@ SETTINGS = [ DpiSliding, # working SpeedChange, MouseGesture, # working + Backlight, Backlight2, # working FnSwap, # simple NewFnSwap, # simple