mirror of
https://github.com/firewalkwithm3/qmk_firmware.git
synced 2024-11-22 19:40:29 +08:00
Improve LED config parsing error messages (#19007)
This commit is contained in:
parent
f7df771e70
commit
d789b4b7d9
|
@ -216,9 +216,9 @@ def _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position
|
||||||
if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2):
|
if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2):
|
||||||
raise ValueError("Unable to parse g_led_config matrix data")
|
raise ValueError("Unable to parse g_led_config matrix data")
|
||||||
if len(position) != len(flags):
|
if len(position) != len(flags):
|
||||||
raise ValueError("Unable to parse g_led_config position data")
|
raise ValueError(f"Number of g_led_config physical positions ({len(position)}) does not match number of flags ({len(flags)})")
|
||||||
if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)):
|
if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)):
|
||||||
raise ValueError("OOB within g_led_config matrix data")
|
raise ValueError(f"LED index {max(matrix_indexes)} is OOB in g_led_config - should be < {len(flags)}")
|
||||||
if not all(isinstance(n, int) for n in matrix_indexes):
|
if not all(isinstance(n, int) for n in matrix_indexes):
|
||||||
raise ValueError("matrix indexes are not all ints")
|
raise ValueError("matrix indexes are not all ints")
|
||||||
if (len(position_raw) % 2) != 0:
|
if (len(position_raw) % 2) != 0:
|
||||||
|
|
Loading…
Reference in a new issue