Add generic handling to cycle LED/RGB Matrix flags (#24649)

This commit is contained in:
Joel Challis 2025-09-22 00:01:23 +01:00 committed by GitHub
parent 115bf771a8
commit 883465d9fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 208 additions and 7 deletions

View file

@ -800,6 +800,14 @@ def _extract_led_config(info_data, keyboard):
if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None):
info_data[feature]['led_count'] = len(info_data[feature]['layout'])
if info_data[feature].get('layout', None) and not info_data[feature].get('flag_steps', None):
flags = {0xFF, 0}
# if only a single flag is used, assume only all+none flags
unique_flags = set(x.get('flags', 0) for x in info_data[feature]['layout'])
if len(unique_flags) > 1:
flags.update(unique_flags)
info_data[feature]['flag_steps'] = sorted(list(flags), reverse=True)
return info_data