diff options
| author | Ryan <fauxpark@gmail.com> | 2022-11-10 01:02:44 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-09 14:02:44 +0000 |
| commit | d789b4b7d9872112dc3389c9f6afe39f537c3723 (patch) | |
| tree | c9d6f512c71c25bcefd7a32fa9bd29df962172f1 /lib/python/qmk/c_parse.py | |
| parent | f7df771e703d47b88a099c1ef6624be6b3b29219 (diff) | |
Improve LED config parsing error messages (#19007)
Diffstat (limited to 'lib/python/qmk/c_parse.py')
| -rw-r--r-- | lib/python/qmk/c_parse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index c14eb490fa..3d73e66091 100644 --- a/lib/python/qmk/c_parse.py +++ b/lib/python/qmk/c_parse.py | |||
| @@ -216,9 +216,9 @@ def _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position | |||
| 216 | if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2): | 216 | if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2): |
| 217 | raise ValueError("Unable to parse g_led_config matrix data") | 217 | raise ValueError("Unable to parse g_led_config matrix data") |
| 218 | if len(position) != len(flags): | 218 | if len(position) != len(flags): |
| 219 | raise ValueError("Unable to parse g_led_config position data") | 219 | raise ValueError(f"Number of g_led_config physical positions ({len(position)}) does not match number of flags ({len(flags)})") |
| 220 | if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)): | 220 | if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)): |
| 221 | raise ValueError("OOB within g_led_config matrix data") | 221 | raise ValueError(f"LED index {max(matrix_indexes)} is OOB in g_led_config - should be < {len(flags)}") |
| 222 | if not all(isinstance(n, int) for n in matrix_indexes): | 222 | if not all(isinstance(n, int) for n in matrix_indexes): |
| 223 | raise ValueError("matrix indexes are not all ints") | 223 | raise ValueError("matrix indexes are not all ints") |
| 224 | if (len(position_raw) % 2) != 0: | 224 | if (len(position_raw) % 2) != 0: |
