diff options
author | Ryan <fauxpark@gmail.com> | 2022-09-26 10:04:21 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 01:04:21 +0100 |
commit | 675d91b813db6488ccc1ca55555ebbf0d4a45dc0 (patch) | |
tree | 1ee01a98cd8c902c267dc52a4a7bfd6cd7adcd60 /lib/python/qmk/cli/generate | |
parent | 5c2b598c42b102f6133a4b8cece61246d09a82fd (diff) |
Generate DD RGBLight/LED/RGB Matrix animation defines (#18459)
Diffstat (limited to 'lib/python/qmk/cli/generate')
-rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index d6e87c8803..3752174841 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -156,6 +156,12 @@ def generate_split_config(kb_info_json, config_h_lines): generate_encoder_config(kb_info_json['split']['encoder']['right'], config_h_lines, '_RIGHT') +def generate_led_animations_config(led_feature_json, config_h_lines, prefix): + for animation in led_feature_json.get('animations', {}): + if led_feature_json['animations'][animation]: + config_h_lines.append(generate_define(f'{prefix}{animation.upper()}')) + + @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate config.h for.') @@ -186,5 +192,14 @@ def generate_config_h(cli): if 'split' in kb_info_json: generate_split_config(kb_info_json, config_h_lines) + if 'led_matrix' in kb_info_json: + generate_led_animations_config(kb_info_json['led_matrix'], config_h_lines, 'ENABLE_LED_MATRIX_') + + if 'rgb_matrix' in kb_info_json: + generate_led_animations_config(kb_info_json['rgb_matrix'], config_h_lines, 'ENABLE_RGB_MATRIX_') + + if 'rgblight' in kb_info_json: + generate_led_animations_config(kb_info_json['rgblight'], config_h_lines, 'RGBLIGHT_EFFECT_') + # Show the results dump_lines(cli.args.output, config_h_lines, cli.args.quiet) |