1
0
Fork 0

Add *_MATRIX_LED_COUNT generation (#21110)

This commit is contained in:
Joel Challis 2023-08-27 04:00:14 +01:00 committed by GitHub
parent 25331be316
commit 95681b8ff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -38,6 +38,10 @@ def _strip_api_content(info_json):
if 'matrix_pins' in info_json:
info_json.pop('matrix_size', None)
for feature in ['rgb_matrix', 'led_matrix']:
if info_json.get(feature, {}).get("layout", None):
info_json[feature].pop('led_count', None)
return info_json

View file

@ -706,6 +706,9 @@ def _extract_led_config(info_data, keyboard):
except Exception as e:
_log_warning(info_data, f'led_config: {file.name}: {e}')
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"])
return info_data