feat: Move LED_COUNT from hwconfig to config.json

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
This commit is contained in:
2025-11-28 18:19:04 +01:00
parent 176fc66c17
commit 2225906664
4 changed files with 8 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import os
class Configuration:
DEFAULT_CONFIG = {
'LED_COUNT': 1,
}
def __init__(self, config_path='/config.json'):
@@ -42,3 +43,6 @@ class Configuration:
self._move_config_to_backup()
os.rename(self.config_path + '.new', self.config_path)
os.sync()
def get_led_count(self):
return self.config.get('LED_COUNT', self.DEFAULT_CONFIG['LED_COUNT'])