aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/info.py
diff options
context:
space:
mode:
authorJoel Challis <[email protected]>2025-09-22 00:01:23 +0100
committerGitHub <[email protected]>2025-09-22 00:01:23 +0100
commit883465d9fb29cd793684ee0ac688ff3517cf8bc0 (patch)
treeb63c7e5fc0ab06c7e34cb2c3001315623a716cc5 /lib/python/qmk/info.py
parent115bf771a8b07bd571ccac52f091e081794d40fd (diff)
downloadqmk_firmware-883465d9fb29cd793684ee0ac688ff3517cf8bc0.tar.gz
qmk_firmware-883465d9fb29cd793684ee0ac688ff3517cf8bc0.zip
Add generic handling to cycle LED/RGB Matrix flags (#24649)
Diffstat (limited to 'lib/python/qmk/info.py')
-rw-r--r--lib/python/qmk/info.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index f63228b2bc..59a64095e7 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -800,6 +800,14 @@ def _extract_led_config(info_data, keyboard):
if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None):
info_data[feature]['led_count'] = len(info_data[feature]['layout'])
+ if info_data[feature].get('layout', None) and not info_data[feature].get('flag_steps', None):
+ flags = {0xFF, 0}
+ # if only a single flag is used, assume only all+none flags
+ unique_flags = set(x.get('flags', 0) for x in info_data[feature]['layout'])
+ if len(unique_flags) > 1:
+ flags.update(unique_flags)
+ info_data[feature]['flag_steps'] = sorted(list(flags), reverse=True)
+
return info_data