aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Challis <[email protected]>2024-03-31 21:38:58 +0100
committerGitHub <[email protected]>2024-03-31 21:38:58 +0100
commitea7194544187c89c0c69dd035d5cd1860ce6813c (patch)
treeafbceabd761a9ff4352028cb20147bcc2770b0d2 /lib
parenta939ee119741eb6d2ef3edefcfdbaad8dda8a7fb (diff)
downloadqmk_firmware-ea7194544187c89c0c69dd035d5cd1860ce6813c.tar.gz
qmk_firmware-ea7194544187c89c0c69dd035d5cd1860ce6813c.zip
Align encoder layout validation with encoder.h logic (#23330)
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 71bb6e9454..e463ac8ce7 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -58,8 +58,13 @@ def _get_key_left_position(key):
def _find_invalid_encoder_index(info_data):
"""Perform additional validation of encoders
"""
- enc_count = len(info_data.get('encoder', {}).get('rotary', []))
- enc_count += len(info_data.get('split', {}).get('encoder', {}).get('right', {}).get('rotary', []))
+ enc_left = info_data.get('encoder', {}).get('rotary', [])
+ enc_right = []
+
+ if info_data.get('split', {}).get('enabled', False):
+ enc_right = info_data.get('split', {}).get('encoder', {}).get('right', {}).get('rotary', enc_left)
+
+ enc_count = len(enc_left) + len(enc_right)
ret = []
layouts = info_data.get('layouts', {})