summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-09-21 11:41:18 +1000
committerGitHub <noreply@github.com>2022-09-21 02:41:18 +0100
commit591701cdf9ae3642daa8ba369327692396065438 (patch)
tree47fc8009af1888990726c6d811d45d4d0cd3cdf3 /lib
parent89a1374ef48869505d9185559f588a49b8b0b23b (diff)
Fix incorrect g_led_config generation (#18431)
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 834f7d9170..5ca282b2d3 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -613,20 +613,24 @@ def _extract_led_config(info_data, keyboard):
cols = info_data['matrix_size']['cols']
rows = info_data['matrix_size']['rows']
- # Assume what feature owns g_led_config
- feature = "rgb_matrix"
- if info_data.get("features", {}).get("led_matrix", False):
+ # Determine what feature owns g_led_config
+ features = info_data.get("features", {})
+ feature = None
+ if features.get("rgb_matrix", False):
+ feature = "rgb_matrix"
+ elif features.get("led_matrix", False):
feature = "led_matrix"
- # Process
- for file in find_keyboard_c(keyboard):
- try:
- ret = find_led_config(file, cols, rows)
- if ret:
- info_data[feature] = info_data.get(feature, {})
- info_data[feature]["layout"] = ret
- except Exception as e:
- _log_warning(info_data, f'led_config: {file.name}: {e}')
+ if feature:
+ # Process
+ for file in find_keyboard_c(keyboard):
+ try:
+ ret = find_led_config(file, cols, rows)
+ if ret:
+ info_data[feature] = info_data.get(feature, {})
+ info_data[feature]["layout"] = ret
+ except Exception as e:
+ _log_warning(info_data, f'led_config: {file.name}: {e}')
return info_data